Skip to content

Commit 4c237d2

Browse files
committed
Merge branch 'tb/gc-recent-object-hook'
Test update. * tb/gc-recent-object-hook: t7701: make annotated tag unreachable
2 parents 3ea43bb + 25d5952 commit 4c237d2

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

t/t7701-repack-unpack-unreachable.sh

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,18 @@ test_expect_success 'gc.recentObjectsHook' '
126126
git cat-file -p $obj2 &&
127127
git cat-file -p $obj3 &&
128128
129-
git tag -a -m tag obj2-tag $obj2 &&
130-
obj2_tag="$(git rev-parse obj2-tag)" &&
129+
# make an unreachable annotated tag object to ensure we rescue objects
130+
# which are reachable from non-pruned unreachable objects
131+
obj2_tag="$(git mktag <<-EOF
132+
object $obj2
133+
type blob
134+
tag obj2-tag
135+
tagger T A Gger <[email protected]> 1234567890 -0000
136+
EOF
137+
)" &&
138+
139+
obj2_tag_pack="$(echo $obj2_tag | git pack-objects .git/objects/pack/pack)" &&
140+
git prune-packed &&
131141
132142
write_script precious-objects <<-EOF &&
133143
echo $obj2_tag
@@ -136,6 +146,7 @@ test_expect_success 'gc.recentObjectsHook' '
136146
137147
test-tool chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&
138148
test-tool chmtime =-86400 .git/objects/pack/pack-$pack3.pack &&
149+
test-tool chmtime =-86400 .git/objects/pack/pack-$obj2_tag_pack.pack &&
139150
git repack -A -d --unpack-unreachable=1.hour.ago &&
140151
141152
git cat-file -p $obj1 &&

0 commit comments

Comments
 (0)