3 test_description
='handling of common mistakes people may make with submodules'
5 TEST_PASSES_SANITIZE_LEAK
=true
8 test_expect_success
'create embedded repository' '
10 test_commit -C embed one
13 test_expect_success
'git-add on embedded repository warns' '
14 test_when_finished "git rm --cached -f embed" &&
15 git add embed 2>stderr &&
16 test_grep warning stderr
19 test_expect_success
'--no-warn-embedded-repo suppresses warning' '
20 test_when_finished "git rm --cached -f embed" &&
21 git add --no-warn-embedded-repo embed 2>stderr &&
22 test_grep ! warning stderr
25 test_expect_success
'no warning when updating entry' '
26 test_when_finished "git rm --cached -f embed" &&
28 git -C embed commit --allow-empty -m two &&
29 git add embed 2>stderr &&
30 test_grep ! warning stderr
33 test_expect_success
'submodule add does not warn' '
34 test_when_finished "git rm -rf submodule .gitmodules" &&
35 git -c protocol.file.allow=always \
36 submodule add ./embed submodule 2>stderr &&
37 test_grep ! warning stderr