3 test_description
='handling of common mistakes people may make with submodules'
6 test_expect_success
'create embedded repository' '
8 test_commit -C embed one
11 test_expect_success
'git-add on embedded repository warns' '
12 test_when_finished "git rm --cached -f embed" &&
13 git add embed 2>stderr &&
14 test_i18ngrep warning stderr
17 test_expect_success
'--no-warn-embedded-repo suppresses warning' '
18 test_when_finished "git rm --cached -f embed" &&
19 git add --no-warn-embedded-repo embed 2>stderr &&
20 test_i18ngrep ! warning stderr
23 test_expect_success
'no warning when updating entry' '
24 test_when_finished "git rm --cached -f embed" &&
26 git -C embed commit --allow-empty -m two &&
27 git add embed 2>stderr &&
28 test_i18ngrep ! warning stderr
31 test_expect_success
'submodule add does not warn' '
32 test_when_finished "git rm -rf submodule .gitmodules" &&
33 git -c protocol.file.allow=always \
34 submodule add ./embed submodule 2>stderr &&
35 test_i18ngrep ! warning stderr