summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-26 21:37:24 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-26 21:37:24 (GMT)
commit03f682bf740e6e617075e7e14e7f477190de8ab3 (patch)
treea493ce22dd767d6cd423f12c0adb013fc391ac29 /t
parentc6b94eb0093216f7a02a8c7a350d1760478a52a1 (diff)
parent2b56bb7a87ab429c225f6325f2870cbeac0d19f9 (diff)
downloadgit-03f682bf740e6e617075e7e14e7f477190de8ab3.zip
git-03f682bf740e6e617075e7e14e7f477190de8ab3.tar.gz
git-03f682bf740e6e617075e7e14e7f477190de8ab3.tar.bz2
Merge branch 'sb/submodule-module-list-fix'
A helper function "git submodule" uses since v2.7.0 to list the modules that match the pathspec argument given to its subcommands (e.g. "submodule add <repo> <path>") has been fixed. * sb/submodule-module-list-fix: submodule helper list: respect correct path prefix
Diffstat (limited to 't')
-rwxr-xr-xt/t7400-submodule-basic.sh25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 540771c..be82a75 100755
--- a/t/t7400-submodule-basic.sh
+++ b/t/t7400-submodule-basic.sh
@@ -999,5 +999,30 @@ test_expect_success 'submodule add clone shallow submodule' '
)
'
+test_expect_success 'submodule helper list is not confused by common prefixes' '
+ mkdir -p dir1/b &&
+ (
+ cd dir1/b &&
+ git init &&
+ echo hi >testfile2 &&
+ git add . &&
+ git commit -m "test1"
+ ) &&
+ mkdir -p dir2/b &&
+ (
+ cd dir2/b &&
+ git init &&
+ echo hello >testfile1 &&
+ git add . &&
+ git commit -m "test2"
+ ) &&
+ git submodule add /dir1/b dir1/b &&
+ git submodule add /dir2/b dir2/b &&
+ git commit -m "first submodule commit" &&
+ git submodule--helper list dir1/b |cut -c51- >actual &&
+ echo "dir1/b" >expect &&
+ test_cmp expect actual
+'
+
test_done