Skip to content

Commit c6fe56d

Browse files
committed
shellcheck fixes in git-cut-branch
1 parent 337c8b4 commit c6fe56d

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

bin/git-cut-branch

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ set -e
1010

1111
# bail out with message to stderr and exit status 1
1212
die() {
13+
# shellcheck disable=SC2086
1314
echo "$(basename $0):" "$@" 1>&2
1415
exit 1
1516
}
@@ -20,6 +21,7 @@ shortsha() {
2021
}
2122

2223
# show usage
24+
# shellcheck disable=SC2166
2325
[ -z "$1" -o "$1" = "--help" ] && {
2426
grep '^#/' "$0" |cut -c4-
2527
exit 2
@@ -44,6 +46,7 @@ remote=$(git config --get "branch.$current.remote" || true)
4446
merge=$(git config --get "branch.$current.merge" | sed 's@refs/heads/@@')
4547

4648
# build up a sane <remote>/<branch> name
49+
# shellcheck disable=SC2166
4750
if [ -n "$remote" -a -n "$merge" ]
4851
then tracking="$remote/$merge"
4952
elif [ -n "$merge" ]
@@ -63,5 +66,7 @@ git reset -q --hard "$tracking"
6366
git checkout -q "$branch"
6467
git branch --set-upstream "$branch" "$tracking"
6568
git reset -q --hard "$sha"
69+
# shellcheck disable=SC2086,SC2046
6670
echo "[$(shortsha "$sha")...$(shortsha $(git rev-parse $tracking))] $current"
71+
# shellcheck disable=SC2046
6772
echo "[0000000...$(shortsha $(git rev-parse HEAD))] $branch"

0 commit comments

Comments
 (0)