author | Jeff King <peff@peff.net> | |
Wed, 3 Sep 2008 18:07:26 +0000 (14:07 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 3 Sep 2008 19:36:38 +0000 (12:36 -0700) | ||
commit | bea005e21bf9f4f19d5e2afe538a5ba9123bdbdc | |
tree | b50998d68b258b1f7682a9cb95b2667a6b26fe57 | tree | snapshot |
parent | 44a68fd526a70f0aaf213143e22f1257f296e724 | commit | diff |
checkout: fix message when leaving detached HEAD
The shell version of git checkout would print:
Previous HEAD position was 1234abcd... commit subject line
when leaving a detached HEAD for another commit. Ths C
version attempted to implement this, but got the condition
wrong such that the behavior never triggered.
This patch simplifies the conditions for showing the message
to the ones used by the shell version: any time we are
leaving a detached HEAD and the new and old commits are not
the same (this suppresses it for the "git checkout -b new"
case recommended when you enter the detached state).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
The shell version of git checkout would print:
Previous HEAD position was 1234abcd... commit subject line
when leaving a detached HEAD for another commit. Ths C
version attempted to implement this, but got the condition
wrong such that the behavior never triggered.
This patch simplifies the conditions for showing the message
to the ones used by the shell version: any time we are
leaving a detached HEAD and the new and old commits are not
the same (this suppresses it for the "git checkout -b new"
case recommended when you enter the detached state).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-checkout.c | diff | blob | history |