From cb2c361746a3c49e77f55f5bf8fa4c2f6570f38b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samo=20Poga=C4=8Dnik?= Date: Sun, 17 Nov 2024 09:19:19 +0100 Subject: [PATCH] Fixing shecheck errors in github checks --- test/clone.t | 2 +- test/config.t | 2 +- test/init.t | 4 ++-- test/issue29.t | 10 +++++----- test/issue95.t | 8 ++++---- test/issue96.t | 10 +++++----- test/push-after-init.t | 4 ++-- test/setup | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/test/clone.t b/test/clone.t index 4a066d7e..03791170 100644 --- a/test/clone.t +++ b/test/clone.t @@ -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: diff --git a/test/config.t b/test/config.t index e06e9890..7a2b9e9e 100644 --- a/test/config.t +++ b/test/config.t @@ -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 diff --git a/test/init.t b/test/init.t index b3450a8e..76d1a8c3 100644 --- a/test/init.t +++ b/test/init.t @@ -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 ) @@ -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 git@github.com:user/repo -b foo -M rebase ) >/dev/null diff --git a/test/issue29.t b/test/issue29.t index c12684e5..b44a6faf 100644 --- a/test/issue29.t +++ b/test/issue29.t @@ -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: @@ -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: @@ -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 diff --git a/test/issue95.t b/test/issue95.t index 46c432dc..2e8262a5 100644 --- a/test/issue95.t +++ b/test/issue95.t @@ -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 @@ -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 @@ -92,7 +92,7 @@ use Test::More cd host git subrepo pull sub )" \ - "Subrepo 'sub' pulled from '../sub' ($DEFAULTBRANCH)." + "Subrepo 'sub' pulled from '../sub' (${DEFAULTBRANCH})." } diff --git a/test/issue96.t b/test/issue96.t index d1250e21..78d8b5ff 100644 --- a/test/issue96.t +++ b/test/issue96.t @@ -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 @@ -84,15 +84,15 @@ use Test::More cd host git subrepo pull sub )" \ - "Subrepo 'sub' pulled from '../sub' ($DEFAULTBRANCH)." + "Subrepo 'sub' pulled from '../sub' (${DEFAULTBRANCH})." # Push subrepo changes # 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)." + "Subrepo 'sub' pushed to '../sub' (${DEFAULTBRANCH})." done_testing 2 diff --git a/test/push-after-init.t b/test/push-after-init.t index e7bda8d4..23bf4c0c 100644 --- a/test/push-after-init.t +++ b/test/push-after-init.t @@ -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" diff --git a/test/setup b/test/setup index d6c22d99..0bcf71e8 100644 --- a/test/setup +++ b/test/setup @@ -62,7 +62,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 ###