]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t2107-update-index-basic.sh
update-index: teach --cacheinfo a new syntax "mode,sha1,path"
[thirdparty/git.git] / t / t2107-update-index-basic.sh
index a6405d318d322b9e1f49e4762570a2c1f5371726..fe2fb17102cdc17168ae2d683d7d51a0b3e3f3bc 100755 (executable)
@@ -48,4 +48,17 @@ test_expect_success '--cacheinfo does not accept gitlink null sha1' '
        test_cmp expect actual
 '
 
+test_expect_success '--cacheinfo mode,sha1,path (new syntax)' '
+       echo content >file &&
+       git hash-object -w --stdin <file >expect &&
+
+       git update-index --add --cacheinfo 100644 "$(cat expect)" file &&
+       git rev-parse :file >actual &&
+       test_cmp expect actual &&
+
+       git update-index --add --cacheinfo "100644,$(cat expect),elif" &&
+       git rev-parse :elif >actual &&
+       test_cmp expect actual
+'
+
 test_done