Skip to content

Commit

Permalink
rebase: give a better error message for bogus branch
Browse files Browse the repository at this point in the history
When you give a non-existent branch to git-rebase, it spits
out the usage. This can be confusing, since you may
understand the usage just fine, but simply have made a
mistake in the branch name.

Before:

  $ git rebase origin bogus
  Usage: git rebase ...

After:

  $ git rebase origin bogus
  fatal: no such branch: bogus
  Usage: git rebase ...

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
peff authored and gitster committed Jan 27, 2011
1 parent 3b21a43 commit 4ac5356
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions git-rebase.sh
Expand Up @@ -491,6 +491,7 @@ case "$#" in
then
head_name="detached HEAD"
else
echo >&2 "fatal: no such branch: $1"
usage
fi
;;
Expand Down

0 comments on commit 4ac5356

Please sign in to comment.