From 1ec648278e3a3e5a04dfaac916f68e2f675ff9ea Mon Sep 17 00:00:00 2001 From: =?utf8?q?Bj=C3=B6rn=20Steinbrink?= Date: Thu, 23 Jul 2009 17:33:45 +0200 Subject: [PATCH] Add a test showing that 'git repack' throws away grafted-away parents MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Björn Steinbrink Signed-off-by: Johannes Schindelin Signed-off-by: Junio C Hamano --- t/t7700-repack.sh | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh index 87c9b0e12..a4dddb728 100755 --- a/t/t7700-repack.sh +++ b/t/t7700-repack.sh @@ -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 -- 2.26.2