Imported Upstream version 2.14.1
[platform/upstream/git.git] / t / t1308-config-set.sh
index 69a0aa5..bafed5c 100755 (executable)
@@ -183,11 +183,22 @@ test_expect_success 'proper error on non-existent files' '
        test_cmp expect actual
 '
 
+test_expect_success 'proper error on directory "files"' '
+       echo "Error (-1) reading configuration file a-directory." >expect &&
+       mkdir a-directory &&
+       test_expect_code 2 test-config configset_get_value foo.bar a-directory 2>output &&
+       grep "^warning:" output &&
+       grep "^Error" output >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success POSIXPERM,SANITY 'proper error on non-accessible files' '
        chmod -r .git/config &&
        test_when_finished "chmod +r .git/config" &&
        echo "Error (-1) reading configuration file .git/config." >expect &&
-       test_expect_code 2 test-config configset_get_value foo.bar .git/config 2>actual &&
+       test_expect_code 2 test-config configset_get_value foo.bar .git/config 2>output &&
+       grep "^warning:" output &&
+       grep "^Error" output >actual &&
        test_cmp expect actual
 '