Imported Upstream version 2.17.0
[platform/upstream/git.git] / t / t0050-filesystem.sh
index 6b3cedc..192c94e 100755 (executable)
@@ -33,16 +33,20 @@ test_expect_success "detection of case insensitive filesystem during repo init"
 '
 else
 test_expect_success "detection of case insensitive filesystem during repo init" '
-       test_must_fail git config --bool core.ignorecase >/dev/null ||
-       test $(git config --bool core.ignorecase) = false
+       {
+               test_must_fail git config --bool core.ignorecase >/dev/null ||
+                       test $(git config --bool core.ignorecase) = false
+       }
 '
 fi
 
 if test_have_prereq SYMLINKS
 then
 test_expect_success "detection of filesystem w/o symlink support during repo init" '
-       test_must_fail git config --bool core.symlinks ||
-       test "$(git config --bool core.symlinks)" = true
+       {
+               test_must_fail git config --bool core.symlinks ||
+               test "$(git config --bool core.symlinks)" = true
+       }
 '
 else
 test_expect_success "detection of filesystem w/o symlink support during repo init" '
@@ -64,7 +68,7 @@ test_expect_success "setup case tests" '
        git checkout -f master
 '
 
-$test_case 'rename (case change)' '
+test_expect_success 'rename (case change)' '
        git mv camelcase CamelCase &&
        git commit -m "rename"
 '
@@ -76,7 +80,21 @@ test_expect_success 'merge (case change)' '
        git merge topic
 '
 
-
+test_expect_success CASE_INSENSITIVE_FS 'add directory (with different case)' '
+       git reset --hard initial &&
+       mkdir -p dir1/dir2 &&
+       echo >dir1/dir2/a &&
+       echo >dir1/dir2/b &&
+       git add dir1/dir2/a &&
+       git add dir1/DIR2/b &&
+       git ls-files >actual &&
+       cat >expected <<-\EOF &&
+               camelcase
+               dir1/dir2/a
+               dir1/dir2/b
+       EOF
+       test_cmp expected actual
+'
 
 test_expect_failure CASE_INSENSITIVE_FS 'add (with different case)' '
        git reset --hard initial &&