summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a7aebb9)
raw | patch | inline | side by side (parent: a7aebb9)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Oct 2009 19:03:25 +0000 (12:03 -0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 Oct 2009 19:03:25 +0000 (12:03 -0700) |
Back when a74b170 (git-pull: disallow implicit merging to detached HEAD,
2007-01-15) added this check, $? referred to the error status of reading
HEAD as a symbolic-ref; but cd67e4d (Teach 'git pull' about --rebase,
2007-11-28) moved the command away from where the check is, and nobody
noticed the breakage. Ever since, $? has always been 0 (tr at the end of
the pipe to find merge_head never fails) and other case arms were never
reached.
These days, error_on_no_merge_candidates function is prepared to handle a
detached HEAD case, which was what the code this patch removes used to
handle.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2007-01-15) added this check, $? referred to the error status of reading
HEAD as a symbolic-ref; but cd67e4d (Teach 'git pull' about --rebase,
2007-11-28) moved the command away from where the check is, and nobody
noticed the breakage. Ever since, $? has always been 0 (tr at the end of
the pipe to find merge_head never fails) and other case arms were never
reached.
These days, error_on_no_merge_candidates function is prepared to handle a
detached HEAD case, which was what the code this patch removes used to
handle.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-pull.sh | patch | blob | history |
diff --git a/git-pull.sh b/git-pull.sh
index edf3ce33bf073c67f65cba0b796e0f9a178b810b..66d73eb59d0ce880df9fcf2d34ecc3069dab189d 100755 (executable)
--- a/git-pull.sh
+++ b/git-pull.sh
case "$merge_head" in
'')
- case $? in
- 0) error_on_no_merge_candidates "$@";;
- 1) echo >&2 "You are not currently on a branch; you must explicitly"
- echo >&2 "specify which branch you wish to merge:"
- echo >&2 " git pull <remote> <branch>"
- exit 1;;
- *) exit $?;;
- esac
+ error_on_no_merge_candidates "$@"
;;
?*' '?*)
if test -z "$orig_head"