git submodule: Fix adding of submodules at paths with ./, .. and //
Make 'git submodule add' normalize the submodule path in the same way as 'git ls-files' does, so that 'git submodule init' looks up the information in .gitmodules with the same key under which 'git submodule add' stores it. This fixes 4 known breakages. Signed-off-by: Michael J Gruber <git@drmicha.warpmail.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
ac8463d2b4
commit
db75ada559
@ -64,7 +64,7 @@ test_expect_success 'submodule add' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_failure 'submodule add with ./ in path' '
|
||||
test_expect_success 'submodule add with ./ in path' '
|
||||
(
|
||||
cd addtest &&
|
||||
git submodule add "$submodurl" ././dotsubmod/./frotz/./ &&
|
||||
@ -72,7 +72,7 @@ test_expect_failure 'submodule add with ./ in path' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_failure 'submodule add with // in path' '
|
||||
test_expect_success 'submodule add with // in path' '
|
||||
(
|
||||
cd addtest &&
|
||||
git submodule add "$submodurl" slashslashsubmod///frotz// &&
|
||||
@ -80,7 +80,7 @@ test_expect_failure 'submodule add with // in path' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_failure 'submodule add with /.. in path' '
|
||||
test_expect_success 'submodule add with /.. in path' '
|
||||
(
|
||||
cd addtest &&
|
||||
git submodule add "$submodurl" dotdotsubmod/../realsubmod/frotz/.. &&
|
||||
@ -88,7 +88,7 @@ test_expect_failure 'submodule add with /.. in path' '
|
||||
)
|
||||
'
|
||||
|
||||
test_expect_failure 'submodule add with ./, /.. and // in path' '
|
||||
test_expect_success 'submodule add with ./, /.. and // in path' '
|
||||
(
|
||||
cd addtest &&
|
||||
git submodule add "$submodurl" dot/dotslashsubmod/./../..////realsubmod2/a/b/c/d/../../../../frotz//.. &&
|
||||
|
||||
Reference in New Issue
Block a user