mirror of
https://github.com/tj/git-extras.git
synced 2026-09-10 07:26:17 -04:00
git-delete-squashed-branches: fail fast if can't checkout
This commit is contained in:
parent
f6fa554077
commit
760e64b864
|
|
@ -1,10 +1,11 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
targetBranch=$1
|
||||
set -euo pipefail
|
||||
|
||||
if [[ -z $targetBranch ]]; then
|
||||
if [[ $# -eq 0 ]]; then
|
||||
targetBranch=$(git rev-parse --abbrev-ref HEAD)
|
||||
else
|
||||
targetBranch=$1
|
||||
git checkout $targetBranch
|
||||
fi
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue