[PATCH] Make git-checkout failure message more friendly.
authorJunio C Hamano <junkio@cox.net>
Fri, 16 Sep 2005 19:30:46 +0000 (12:30 -0700)
committerJunio C Hamano <junkio@cox.net>
Fri, 16 Sep 2005 22:16:40 +0000 (15:16 -0700)
... or less so, perhaps ;-). Suggested by Jeff Garzik.

Signed-off-by: Junio C Hamano <junkio@cox.net>
git-checkout.sh
index 4a605cd9c6d76dc99ab0574dc3571db3b64e509c..e02c7afbaed52e83a01a68a65ff950b07c04f839 100755 (executable)
@@ -22,7 +22,8 @@ while [ "$#" != "0" ]; do
                force=1
                ;;
        *)
-               rev=$(git-rev-parse --verify "$arg^0") || exit
+               rev=$(git-rev-parse --verify "$arg^0" 2>/dev/null) ||
+                       die "hey dummy, branch '$arg' doesn't exist."
                if [ -z "$rev" ]; then
                        echo "unknown flag $arg"
                        exit 1