diff options
author | Johannes Sixt <j6t@kdbg.org> | 2012-05-04 22:14:48 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-05-04 23:42:27 +0400 |
commit | 5d8863954f077d2c262d5cc4fc669947ff23d6d5 (patch) | |
tree | 56aaf37abe80507c48f69e60fac116d46355b05a /t | |
parent | f94920993a0a1ba7916618e2ab458d5d4fb21e94 (diff) |
checkout (detached): truncate list of orphaned commits at the new HEAD
When git checkout switches from a detached HEAD to any other commit, then
all orphaned commits were listed in a warning:
Warning: you are leaving 2 commits behind...:
a5e5396 another fixup
6aa1af6 fixup foo
But if the new commit is actually one from this list (6aa1af6 in this
example), then the list in the warning can be truncated at the new HEAD,
because history beginning at HEAD is not "left behind". This makes it so.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t2020-checkout-detach.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t2020-checkout-detach.sh b/t/t2020-checkout-detach.sh index 202ca90c34..f63333b64e 100755 --- a/t/t2020-checkout-detach.sh +++ b/t/t2020-checkout-detach.sh @@ -126,7 +126,7 @@ test_expect_success 'checkout warns orphaning 1 of 2 commits' ' ' test_expect_success 'checkout warns orphaning 1 of 2 commits: output' ' - check_orphan_warning stderr "2 commits" + check_orphan_warning stderr "1 commit" ' test_expect_success 'checkout does not warn leaving ref tip' ' |