Skip to content

Commit

Permalink
Add a test showing that 'git repack' throws away grafted-away parents
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Björn Steinbrink authored and Junio C Hamano committed Jul 24, 2009
1 parent 735c674 commit 1ec6482
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions t/t7700-repack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 1ec6482

Please sign in to comment.