sequencer: lib'ify read_and_refresh_cache()
[gitweb.git] / t / t7701-repack-unpack-unreachable.sh
index f13df432992dc6da82fcca9317447b2d8381279b..987573c41fcd4aee3d5f8fd8aa587c97551c1872 100755 (executable)
@@ -137,4 +137,17 @@ test_expect_success 'repack -k keeps unreachable packed objects' '
        test_must_fail git cat-file -p $sha1
 '
 
+test_expect_success 'repack -k packs unreachable loose objects' '
+       # create loose unreachable object
+       sha1=$(echo would-be-deleted-loose | git hash-object -w --stdin) &&
+       objpath=.git/objects/$(echo $sha1 | sed "s,..,&/,") &&
+       test_path_is_file $objpath &&
+
+       # and confirm that the loose object goes away, but we can
+       # still access it (ergo, it is packed)
+       git repack -adk &&
+       test_path_is_missing $objpath &&
+       git cat-file -p $sha1
+'
+
 test_done