aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgit-branch-list5
1 files changed, 5 insertions, 0 deletions
diff --git a/git-branch-list b/git-branch-list
index bf55624..c0e355c 100755
--- a/git-branch-list
+++ b/git-branch-list
@@ -56,6 +56,11 @@ function checkout_branch () {
fgrep "$id " |
cut -d ' ' -f 2)
+ if [ "$branch" = '' ]; then
+ echo 'branch-list: Invalid checkout ID' 1>&2
+ return 1
+ fi
+
git checkout "$branch"
}