t: test http access to "half-auth" repositories
[gitweb.git] / t / t7701-repack-unpack-unreachable.sh
index 200ab61278643e8b9deb4f624a95378e7e4c5b67..b8d4cdea8cc661e27367bc942587b3b80b433051 100755 (executable)
@@ -95,4 +95,18 @@ test_expect_success 'unpacked objects receive timestamp of pack file' '
        compare_mtimes < mtimes
 '
 
+test_expect_success 'do not bother loosening old objects' '
+       obj1=$(echo one | git hash-object -w --stdin) &&
+       obj2=$(echo two | git hash-object -w --stdin) &&
+       pack1=$(echo $obj1 | git pack-objects .git/objects/pack/pack) &&
+       pack2=$(echo $obj2 | git pack-objects .git/objects/pack/pack) &&
+       git prune-packed &&
+       git cat-file -p $obj1 &&
+       git cat-file -p $obj2 &&
+       test-chmtime =-86400 .git/objects/pack/pack-$pack2.pack &&
+       git repack -A -d --unpack-unreachable=1.hour.ago &&
+       git cat-file -p $obj1 &&
+       test_must_fail git cat-file -p $obj2
+'
+
 test_done