Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2021-09-24 21:36:42 +0300
committerJunio C Hamano <gitster@pobox.com>2021-09-27 22:36:45 +0300
commit078eecbcbe04bf77e8b9afee01a58c905c3b3c50 (patch)
tree211e160616da25fbb049266b34f619d86435258a /t/t5312-prune-corruption.sh
parentf805844676ac4d6f5def5c2ace1d0430c410e21e (diff)
t5312: test non-destructive repack
In t5312, we create a state with a broken ref, and then make sure that destructive repacks don't silently ignore the breakage (where a destructive repack is one that might drop objects). But we don't check the behavior of non-destructive repacks at all (i.e., ones where we'd keep unreachable objects). So let's add a test to confirm the current behavior, which is that they are allowed (i.e., ignoring the breakage and considering any objects it points to as unreachable). This may change in the future, but we'd like for the test suite to alert us to that fact. Signed-off-by: Jeff King <peff@peff.net> Reviewed-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5312-prune-corruption.sh')
-rwxr-xr-xt/t5312-prune-corruption.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/t/t5312-prune-corruption.sh b/t/t5312-prune-corruption.sh
index 0704f3e930..c7010fb754 100755
--- a/t/t5312-prune-corruption.sh
+++ b/t/t5312-prune-corruption.sh
@@ -46,6 +46,11 @@ test_expect_success 'put bogus object into pack' '
git cat-file -e $bogus
'
+test_expect_success 'non-destructive repack ignores bogus name' '
+ create_bogus_ref &&
+ git repack -adk
+'
+
test_expect_success 'destructive repack keeps packed object' '
create_bogus_ref &&
test_might_fail git repack -Ad --unpack-unreachable=now &&