3 test_description='check handling of .gitmodule path with dash'
6 test_expect_success 'create submodule with dash in path' '
8 git -C upstream commit --allow-empty -m base &&
9 git submodule add ./upstream sub &&
11 git commit -m submodule
14 test_expect_success 'clone rejects unprotected dash' '
15 test_when_finished "rm -rf dst" &&
16 git clone --recurse-submodules . dst 2>err &&
17 test_i18ngrep ignoring err
20 test_expect_success MINGW 'submodule paths disallows trailing spaces' '
22 test_must_fail git -C super submodule add ../upstream "sub " &&
24 : add "sub", then rename "sub" to "sub ", the hard way &&
25 git -C super submodule add ../upstream sub &&
26 tree=$(git -C super write-tree) &&
27 git -C super ls-tree $tree >tree &&
28 sed "s/sub/sub /" <tree >tree.new &&
29 tree=$(git -C super mktree <tree.new) &&
30 commit=$(echo with space | git -C super commit-tree $tree) &&
31 git -C super update-ref refs/heads/master $commit &&
33 test_must_fail git clone --recurse-submodules super dst 2>err &&
34 test_i18ngrep "sub " err