summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-06-16 08:22:35 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-06-16 08:22:35 (GMT)
commitad2a2f6f0b40ba7c3dea8ec8ddcbc3f65f083998 (patch)
treedee9b00895f51a10f5e3cddd768b099a04fb41c0 /t
parent5bd148bfe8a4f2df8487e029cd4ee6809bc4c963 (diff)
parenta88ca3427770b9142db71c29154abcce4c5b8a9d (diff)
downloadgit-ad2a2f6f0b40ba7c3dea8ec8ddcbc3f65f083998.zip
git-ad2a2f6f0b40ba7c3dea8ec8ddcbc3f65f083998.tar.gz
git-ad2a2f6f0b40ba7c3dea8ec8ddcbc3f65f083998.tar.bz2
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-xt/t7400-submodule-basic.sh22
1 files changed, 17 insertions, 5 deletions
diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
index 3940433..7a9b505 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