1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-19 14:49:15 +02:00

Add a test showing that 'git repack' throws away grafted-away parents

Signed-off-by: Björn Steinbrink <B.Steinbrink@gmx.de>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Björn Steinbrink 2009-07-23 17:33:45 +02:00 committed by Junio C Hamano
parent 735c674416
commit 1ec648278e

View File

@ -149,5 +149,17 @@ test_expect_success 'local packed unreachable obs that exist in alternate ODB ar
test_must_fail git show $csha1
'
test_expect_failure 'objects made unreachable by grafts only are kept' '
test_tick &&
git commit --allow-empty -m "commit 4" &&
H0=$(git rev-parse HEAD) &&
H1=$(git rev-parse HEAD^) &&
H2=$(git rev-parse HEAD^^) &&
echo "$H0 $H2" > .git/info/grafts &&
git reflog expire --expire=now --expire-unreachable=now --all &&
git repack -a -d &&
git cat-file -t $H1
'
test_done