test prerequisites: enumerate with commas
[gitweb.git] / t / t2107-update-index-basic.sh
index a6405d318d322b9e1f49e4762570a2c1f5371726..1bafb9098c7fae33969e9231fbdee1c0370830a1 100755 (executable)
@@ -29,6 +29,10 @@ test_expect_success 'update-index -h with corrupt index' '
        test_i18ngrep "[Uu]sage: git update-index" broken/usage
 '
 
+test_expect_success '--cacheinfo complains of missing arguments' '
+       test_must_fail git update-index --cacheinfo
+'
+
 test_expect_success '--cacheinfo does not accept blob null sha1' '
        echo content >file &&
        git add file &&
@@ -48,4 +52,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