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>
Björn Steinbrink committed
Jul 23, 2009 at 17:33 UTC
1ec648278e3a3e5a04dfaac916f68e2f675ff9ea
1 file changed
+12
t/t7700-repack.sh
+12
@@ -149,5 +149,17 @@ test_expect_success 'local packed unreachable obs that exist in alternate ODB ar
149
test_must_fail git show $csha1
150
'
151
152
+test_expect_failure 'objects made unreachable by grafts only are kept' '
153
+ test_tick &&
154
+ git commit --allow-empty -m "commit 4" &&
155
+ H0=$(git rev-parse HEAD) &&
156
+ H1=$(git rev-parse HEAD^) &&
157
+ H2=$(git rev-parse HEAD^^) &&
158
+ echo "$H0 $H2" > .git/info/grafts &&
159
+ git reflog expire --expire=now --expire-unreachable=now --all &&
160
+ git repack -a -d &&
161
+ git cat-file -t $H1
162
+ '
163
+
164
test_done
165