diff options
author | Junio C Hamano <gitster@pobox.com> | 2007-06-16 01:22:35 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-06-16 01:22:35 -0700 |
commit | ad2a2f6f0b40ba7c3dea8ec8ddcbc3f65f083998 (patch) | |
tree | dee9b00895f51a10f5e3cddd768b099a04fb41c0 /t | |
parent | Merge branch 'maint' to sync with GIT 1.5.2.2 (diff) | |
parent | gitmodules(5): remove leading period from synopsis (diff) | |
download | tgif-ad2a2f6f0b40ba7c3dea8ec8ddcbc3f65f083998.tar.xz |
Merge branch 'lh/submodule'
* lh/submodule:
gitmodules(5): remove leading period from synopsis
Add gitmodules(5)
git-submodule: give submodules proper names
Rename sections from "module" to "submodule" in .gitmodules
git-submodule: remember to checkout after clone
t7400: barf if git-submodule removes or replaces a file
Diffstat (limited to 't')
-rwxr-xr-x | t/t7400-submodule-basic.sh | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh index 3940433b8f..7a9b505b13 100755 --- a/t/t7400-submodule-basic.sh +++ b/t/t7400-submodule-basic.sh @@ -18,7 +18,7 @@ subcommands of git-submodule. # -add directory lib to 'superproject', this creates a DIRLINK entry # -add a couple of regular files to enable testing of submodule filtering # -mv lib subrepo -# -add an entry to .gitmodules for path 'lib' +# -add an entry to .gitmodules for submodule 'example' # test_expect_success 'Prepare submodule testing' ' mkdir lib && @@ -40,7 +40,19 @@ test_expect_success 'Prepare submodule testing' ' git-add a lib z && git-commit -m "super commit 1" && mv lib .subrepo && - GIT_CONFIG=.gitmodules git-config module.lib.url git://example.com/lib.git + GIT_CONFIG=.gitmodules git-config submodule.example.url git://example.com/lib.git +' + +test_expect_success 'status should fail for unmapped paths' ' + if git-submodule status + then + echo "[OOPS] submodule status succeeded" + false + elif ! GIT_CONFIG=.gitmodules git-config submodule.example.path lib + then + echo "[OOPS] git-config failed to update .gitmodules" + false + fi ' test_expect_success 'status should only print one line' ' @@ -54,12 +66,12 @@ test_expect_success 'status should initially be "missing"' ' test_expect_success 'init should register submodule url in .git/config' ' git-submodule init && - url=$(git-config submodule.lib.url) && + url=$(git-config submodule.example.url) && if test "$url" != "git://example.com/lib.git" then echo "[OOPS] init succeeded but submodule url is wrong" false - elif ! git-config submodule.lib.url ./.subrepo + elif ! git-config submodule.example.url ./.subrepo then echo "[OOPS] init succeeded but update of url failed" false @@ -72,7 +84,7 @@ test_expect_success 'update should fail when path is used by a file' ' then echo "[OOPS] update should have failed" false - elif test -f lib && test "$(cat lib)" != "hello" + elif test "$(cat lib)" != "hello" then echo "[OOPS] update failed but lib file was molested" false |