Skip to content

Commit 4ac5356

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 3b21a43 commit 4ac5356

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

git-rebase.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -491,6 +491,7 @@ case "$#" in
491491
then
492492
head_name="detached HEAD"
493493
else
494+
echo >&2 "fatal: no such branch: $1"
494495
usage
495496
fi
496497
;;

0 commit comments

Comments
 (0)