Skip to content

Commit

Permalink
Fixing shellcheck errors found during docker-test
Browse files Browse the repository at this point in the history
  • Loading branch information
spog committed Dec 1, 2024
1 parent 346e230 commit 9d2d959
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion test/clone.t
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ clone-foo-and-bar

(
mkdir -p "$OWNER/empty"
git init --initial-branch=$DEFAULTBRANCH "$OWNER/empty"
git init --initial-branch="${DEFAULTBRANCH}" "$OWNER/empty"
)

# Test that the repos look ok:
Expand Down
2 changes: 1 addition & 1 deletion test/config.t
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ gitrepo=$OWNER/init/doc/.gitrepo
cd "$OWNER/init"
git config user.email "ini@ini"
git config user.name "IniUser"
git config init.defaultBranch $DEFAULTBRANCH
git config init.defaultBranch "${DEFAULTBRANCH}"
git subrepo init doc
) > /dev/null

Expand Down
4 changes: 2 additions & 2 deletions test/init.t
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ output=$(
cd "$OWNER/init"
git config user.email "ini@ini"
git config user.name "IniUser"
git config init.defaultBranch $DEFAULTBRANCH
git config init.defaultBranch "${DEFAULTBRANCH}"
git subrepo init doc
)

Expand Down Expand Up @@ -53,7 +53,7 @@ git clone "$UPSTREAM/init" "$OWNER/init" &>/dev/null
cd "$OWNER/init"
git config user.email "ini@ini"
git config user.name "IniUser"
git config init.defaultBranch $DEFAULTBRANCH
git config init.defaultBranch "${DEFAULTBRANCH}"
git subrepo init doc -r [email protected]:user/repo -b foo -M rebase
) >/dev/null

Expand Down
10 changes: 5 additions & 5 deletions test/issue29.t
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ cd "$TMP"
# Make 3 new repos:
(
mkdir share main1 main2
git init --initial-branch=$DEFAULTBRANCH share
git init --initial-branch=$DEFAULTBRANCH main1
git init --initial-branch=$DEFAULTBRANCH main2
git init --initial-branch="${DEFAULTBRANCH}" share
git init --initial-branch="${DEFAULTBRANCH}" main1
git init --initial-branch="${DEFAULTBRANCH}" main2
) > /dev/null

# Add an empty 'readme' to the share repo:
Expand All @@ -44,7 +44,7 @@ cd "$TMP"
touch main1
git add main1
git commit -m "Initial main1"
git subrepo clone ../share share -b "$DEFAULTBRANCH"
git subrepo clone ../share share -b "${DEFAULTBRANCH}"
) > /dev/null

# `subrepo clone` the share repo into main2:
Expand All @@ -55,7 +55,7 @@ cd "$TMP"
touch main2
git add main2
git commit -m "Initial main2"
git subrepo clone ../share share -b "$DEFAULTBRANCH"
git subrepo clone ../share share -b "${DEFAULTBRANCH}"
) > /dev/null


Expand Down
6 changes: 3 additions & 3 deletions test/issue95.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use Test::More
# Make two new repos
(
mkdir host sub
git init --initial-branch=$DEFAULTBRANCH host
git init --initial-branch=$DEFAULTBRANCH sub
git init --initial-branch="${DEFAULTBRANCH}" host
git init --initial-branch="${DEFAULTBRANCH}" sub
) > /dev/null

# Initialize host repo
Expand Down Expand Up @@ -49,7 +49,7 @@ use Test::More
touch feature
git add feature
git commit -m "feature added"
git checkout "$DEFAULTBRANCH"
git checkout "${DEFAULTBRANCH}"
) &> /dev/null

# Commit directly to subrepo
Expand Down
6 changes: 3 additions & 3 deletions test/issue96.t
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ use Test::More
# Make two new repos
(
mkdir host sub
git init --initial-branch=$DEFAULTBRANCH host
git init --initial-branch=$DEFAULTBRANCH sub
git init --initial-branch="${DEFAULTBRANCH}" host
git init --initial-branch="${DEFAULTBRANCH}" sub
) > /dev/null

# Initialize host repo
Expand Down Expand Up @@ -90,7 +90,7 @@ use Test::More
# expected: successful push without conflicts
is "$(
cd host
git subrepo push sub -b "$DEFAULTBRANCH" -u
git subrepo push sub -b "${DEFAULTBRANCH}" -u
)" \
"Subrepo 'sub' pushed to '../sub' ($DEFAULTBRANCH)."

Expand Down
4 changes: 2 additions & 2 deletions test/push-after-init.t
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ use Test::More
(
mkdir -p "$OWNER/init"
cd "$OWNER/init"
git init --initial-branch=$DEFAULTBRANCH
git init --initial-branch="${DEFAULTBRANCH}"
git config user.name "IniUser"
git config user.email "ini@ini"
mkdir doc
add-new-files doc/FooBar
git subrepo init doc || die
mkdir ../upstream
git init --initial-branch=$DEFAULTBRANCH --bare ../upstream || die
git init --initial-branch="${DEFAULTBRANCH}" --bare ../upstream || die
cd ../upstream
git config user.name "UpsUser"
git config user.email "ups@ups"
Expand Down
6 changes: 3 additions & 3 deletions test/setup
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ mkdir -p "$UPSTREAM" "$OWNER" "$COLLAB"
cp -r test/repo/{foo,bar,init} "$UPSTREAM/"

DEFAULTBRANCH=$( git config --global --get init.defaultbranch || true )
[[ -z $DEFAULTBRANCH ]] && DEFAULTBRANCH="master"
[[ -z "${DEFAULTBRANCH}" ]] && DEFAULTBRANCH="master"
export DEFAULTBRANCH

###
Expand All @@ -73,15 +73,15 @@ clone-foo-and-bar() {
cd "$OWNER/foo"
git config user.name "FooUser"
git config user.email "foo@foo"
git config init.defaultBranch $DEFAULTBRANCH
git config init.defaultBranch "${DEFAULTBRANCH}"
)
# bar will act as the subrepo
git clone "$UPSTREAM/bar" "$OWNER/bar"
(
cd "$OWNER/bar"
git config user.name "BarUser"
git config user.email "bar@bar"
git config init.defaultBranch $DEFAULTBRANCH
git config init.defaultBranch "${DEFAULTBRANCH}"
)
) &> /dev/null || die
}
Expand Down

0 comments on commit 9d2d959

Please sign in to comment.