t3211: demonstrate loss of peeled refs if a packed ref is deleted
authorMichael Haggerty <mhagger@alum.mit.edu>
Mon, 22 Apr 2013 19:52:28 +0000 (21:52 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 1 May 2013 22:33:10 +0000 (15:33 -0700)
Add a test that demonstrates that the peeled values recorded in
packed-refs are lost if a packed ref is deleted. (The code in
repack_without_ref() doesn't even attempt to write peeled refs.) This
will be fixed in a moment.

Signed-off-by: Michael Haggerty <mhagger@alum.mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t3211-peel-ref.sh
index d4d7792eae845096f8f89ef4d31171d55dac5659..cca1acb18497fd764c2efd3baba1d0d658207051 100755 (executable)
@@ -61,4 +61,13 @@ test_expect_success 'refs are peeled outside of refs/tags (old packed)' '
        test_cmp expect actual
 '
 
        test_cmp expect actual
 '
 
+test_expect_failure 'peeled refs survive deletion of packed ref' '
+       git pack-refs --all &&
+       cp .git/packed-refs fully-peeled &&
+       git branch yadda &&
+       git pack-refs --all &&
+       git branch -d yadda &&
+       test_cmp fully-peeled .git/packed-refs
+'
+
 test_done
 test_done