aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xgit-branch-list9
1 files changed, 7 insertions, 2 deletions
diff --git a/git-branch-list b/git-branch-list
index bd85160..bf55624 100755
--- a/git-branch-list
+++ b/git-branch-list
@@ -93,7 +93,12 @@ case "$command" in
exit $?
;;
*)
- # if $1 is an integer
- checkout_branch "$1"
+ # If `$1` is an integer
+ if [ "$1" -eq "$1" ] 2>/dev/null; then
+ checkout_branch "$1"
+ else
+ exit 1
+ fi
+
;;
esac