diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-12-23 11:33:15 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-12-23 11:33:15 +0900 |
| commit | 00bf98b16e3dfaf0e980954a3add41818e4bb0c3 (patch) | |
| tree | a465682c7a6c1a3abc06b68981a51e6bf34d6049 /t/t7400-submodule-basic.sh | |
| parent | f0c063b67c66fa9eb377097efc7614c5f102c5be (diff) | |
| parent | dd8e8c786efdfb3ba588d807bfb0dc0d5196c343 (diff) | |
| download | git-00bf98b16e3dfaf0e980954a3add41818e4bb0c3.tar.xz | |
Merge branch 'jc/submodule-add'
"git submodule add" to add a submodule under <name> segfaulted,
when a submodule.<name>.something is already in .gitmodules file
without defining where its submodule.<name>.path is, which has been
corrected.
* jc/submodule-add:
submodule add: sanity check existing .gitmodules
Diffstat (limited to 't/t7400-submodule-basic.sh')
| -rwxr-xr-x | t/t7400-submodule-basic.sh | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index e6b551daad..65fcfae93a 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -48,6 +48,25 @@ test_expect_success 'submodule deinit works on empty repository' ' git submodule deinit --all ' +test_expect_success 'submodule add with incomplete .gitmodules' ' + test_when_finished "rm -f expect actual" && + test_when_finished "git config remove-section submodule.one" && + test_when_finished "git rm -f one .gitmodules" && + git init one && + git -C one commit --allow-empty -m one-initial && + git config -f .gitmodules submodule.one.ignore all && + + git submodule add ./one && + + for var in ignore path url + do + git config -f .gitmodules --get "submodule.one.$var" || + return 1 + done >actual && + test_write_lines all one ./one >expect && + test_cmp expect actual +' + test_expect_success 'setup - initial commit' ' >t && git add t && |
