t7700: demonstrate mishandling of loose objects in an alternate ODB
Loose objects residing in an alternate object database should not be packed when the -l option to repack is used. Signed-off-by: Brandon Casey <drafnel@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Brandon Casey committed
Nov 9, 2008 at 23:59 UTC
3c3df429106770966397086b6d2bced452ec7383
1 file changed
+19
t/t7700-repack.sh
+19
@@ -34,5 +34,24 @@ test_expect_success 'objects in packs marked .keep are not repacked' '
34
test -z "$found_duplicate_object"
35
'
36
37
+test_expect_failure 'loose objects in alternate ODB are not repacked' '
38
+ mkdir alt_objects &&
39
+ echo `pwd`/alt_objects > .git/objects/info/alternates &&
40
+ echo content3 > file3 &&
41
+ objsha1=$(GIT_OBJECT_DIRECTORY=alt_objects git hash-object -w file3) &&
42
+ git add file3 &&
43
+ git commit -m commit_file3 &&
44
+ git repack -a -d -l &&
45
+ git prune-packed &&
46
+ for p in .git/objects/pack/*.idx; do
47
+ if git verify-pack -v $p | egrep "^$objsha1"; then
48
+ found_duplicate_object=1
49
+ echo "DUPLICATE OBJECT FOUND"
50
+ break
51
+ fi
52
+ done &&
53
+ test -z "$found_duplicate_object"
54
+'
55
+
56
test_done
57