rebase: give a better error message for bogus branch

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>
This commit is contained in:
Jeff King 2011-01-26 19:27:11 -05:00 коммит произвёл Junio C Hamano
Родитель 3b21a438c9
Коммит 4ac5356c62
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -491,6 +491,7 @@ case "$#" in
then
head_name="detached HEAD"
else
echo >&2 "fatal: no such branch: $1"
usage
fi
;;