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:
authorJunio C Hamano <gitster@pobox.com>2023-06-30 02:43:21 +0300
committerJunio C Hamano <gitster@pobox.com>2023-06-30 02:43:21 +0300
commit4c237d2ca2b5aa1f8b79e9ac5e1afa907436fbfe (patch)
tree5264a27a3a090cf6f0600961b8ce6b0488cf1267
parent3ea43bbe17b9f0d8ffcad17ce602d36ea0668ab8 (diff)
parent25d59524bbc79b4f4560fca1b9b22c8c36780636 (diff)
Merge branch 'tb/gc-recent-object-hook'
Test update. * tb/gc-recent-object-hook: t7701: make annotated tag unreachable
-rwxr-xr-xt/t7701-repack-unpack-unreachable.sh15
1 files changed, 13 insertions, 2 deletions
diff --git a/t/t7701-repack-unpack-unreachable.sh b/t/t7701-repack-unpack-unreachable.sh
index ba428c18a8..fe6c3e77a3 100755
--- a/t/t7701-repack-unpack-unreachable.sh
+++ b/t/t7701-repack-unpack-unreachable.sh
@@ -126,8 +126,18 @@ test_expect_success 'gc.recentObjectsHook' '
git cat-file -p $obj2 &&
git cat-file -p $obj3 &&
- git tag -a -m tag obj2-tag $obj2 &&
- obj2_tag="$(git rev-parse obj2-tag)" &&
+ # make an unreachable annotated tag object to ensure we rescue objects
+ # which are reachable from non-pruned unreachable objects
+ obj2_tag="$(git mktag <<-EOF
+ object $obj2
+ type blob
+ tag obj2-tag
+ tagger T A Gger <tagger@example.com> 1234567890 -0000
+ EOF
+ )" &&
+
+ obj2_tag_pack="$(echo $obj2_tag | git pack-objects .git/objects/pack/pack)" &&
+ git prune-packed &&
write_script precious-objects <<-EOF &&
echo $obj2_tag
@@ -136,6 +146,7 @@ test_expect_success 'gc.recentObjectsHook' '
test-tool chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&
test-tool chmtime =-86400 .git/objects/pack/pack-$pack3.pack &&
+ test-tool chmtime =-86400 .git/objects/pack/pack-$obj2_tag_pack.pack &&
git repack -A -d --unpack-unreachable=1.hour.ago &&
git cat-file -p $obj1 &&