tests: rename a test having to do with shallow submodules
[gitweb.git] / t / t3007-ls-files-recurse-submodules.sh
index a5426171d3ec652ffc02fc8279bc5802f57204a3..4cf6ccf5a8eadac4cc0ebb8b3091f1f3befa73a9 100755 (executable)
@@ -188,6 +188,45 @@ test_expect_success '--recurse-submodules and pathspecs' '
        test_cmp expect actual
 '
 
+test_expect_success '--recurse-submodules and relative paths' '
+       # From subdir
+       cat >expect <<-\EOF &&
+       b
+       EOF
+       git -C b ls-files --recurse-submodules >actual &&
+       test_cmp expect actual &&
+
+       # Relative path to top
+       cat >expect <<-\EOF &&
+       ../.gitmodules
+       ../a
+       b
+       ../h.txt
+       ../sib/file
+       ../sub/file
+       ../submodule/.gitmodules
+       ../submodule/c
+       ../submodule/f.TXT
+       ../submodule/g.txt
+       ../submodule/subsub/d
+       ../submodule/subsub/e.txt
+       EOF
+       git -C b ls-files --recurse-submodules -- .. >actual &&
+       test_cmp expect actual &&
+
+       # Relative path to submodule
+       cat >expect <<-\EOF &&
+       ../submodule/.gitmodules
+       ../submodule/c
+       ../submodule/f.TXT
+       ../submodule/g.txt
+       ../submodule/subsub/d
+       ../submodule/subsub/e.txt
+       EOF
+       git -C b ls-files --recurse-submodules -- ../submodule >actual &&
+       test_cmp expect actual
+'
+
 test_expect_success '--recurse-submodules does not support --error-unmatch' '
        test_must_fail git ls-files --recurse-submodules --error-unmatch 2>actual &&
        test_i18ngrep "does not support --error-unmatch" actual