Skip to content

Commit 760e64b

Browse files
committed
git-delete-squashed-branches: fail fast if can't checkout
1 parent f6fa554 commit 760e64b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bin/git-delete-squashed-branches

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/usr/bin/env bash
22

3-
targetBranch=$1
3+
set -euo pipefail
44

5-
if [[ -z $targetBranch ]]; then
5+
if [[ $# -eq 0 ]]; then
66
targetBranch=$(git rev-parse --abbrev-ref HEAD)
77
else
8+
targetBranch=$1
89
git checkout $targetBranch
910
fi
1011

0 commit comments

Comments
 (0)