Add test to check if 'git submodule add' works on paths which are tracked by Git. Helped-by: Christian Couder <christian.couder@xxxxxxxxx> Helped-by: Kaartic Sivaraam <kaartic.sivaraam@xxxxxxxxx> Signed-off-by: Shourya Shukla <shouryashukla.oo@xxxxxxxxx> --- t/t7400-submodule-basic.sh | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index 4ab8298385..d9317192e0 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -193,6 +193,17 @@ test_expect_success 'submodule add to .gitignored path with --force' ' ) ' +test_expect_success 'submodule add to path with tracked contents fails' ' + ( + cd addtest-ignore && + mkdir track && + git add -f track && + git commit -m "add tracked path" && + ! git submodule add "$submodurl" submod >output 2>&1 && + test_file_not_empty output + ) +' + test_expect_success 'submodule add to reconfigure existing submodule with --force' ' ( cd addtest-ignore && -- 2.28.0