Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
demonstrate breakage of detached checkout with symbolic link HEAD
author
Junio C Hamano
<gitster@pobox.com>
Fri, 17 Oct 2008 22:56:11 +0000
(15:56 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Sun, 19 Oct 2008 19:35:04 +0000
(12:35 -0700)
When core.prefersymlinkrefs is in use, detaching the HEAD by
checkout incorrectly clobbers the tip of the current branch.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t7201-co.sh
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
51a94af
)
diff --git
a/t/t7201-co.sh
b/t/t7201-co.sh
index ee2cab6bb2162e4060227adae82d742d6677cf1a..3f70adaf5a1449f09ca062e45915783d6b6cbf4b 100755
(executable)
--- a/
t/t7201-co.sh
+++ b/
t/t7201-co.sh
@@
-339,6
+339,18
@@
test_expect_success 'checkout w/--track from non-branch HEAD fails' '
test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"
'
test "z$(git rev-parse master^0)" = "z$(git rev-parse HEAD)"
'
+test_expect_failure 'detach a symbolic link HEAD' '
+ git checkout master &&
+ git config --bool core.prefersymlinkrefs yes &&
+ git checkout side &&
+ git checkout master &&
+ it=$(git symbolic-ref HEAD) &&
+ test "z$it" = zrefs/heads/master &&
+ here=$(git rev-parse --verify refs/heads/master) &&
+ git checkout side^ &&
+ test "z$(git rev-parse --verify refs/heads/master)" = "z$here"
+'
+
test_expect_success 'checkout an unmerged path should fail' '
rm -f .git/index &&
O=$(echo original | git hash-object -w --stdin) &&
test_expect_success 'checkout an unmerged path should fail' '
rm -f .git/index &&
O=$(echo original | git hash-object -w --stdin) &&