summaryrefslogtreecommitdiff
path: root/t/t7403-submodule-sync.sh
diff options
context:
space:
mode:
authorAndreas Köhler <andi5.py@gmx.net>2010-10-08 01:07:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2010-10-14 01:31:45 (GMT)
commit33f072f8910081b12780197a2a5423227e437af8 (patch)
treeabfa4e5e3842c55dde210c298c613ae92dcf90cf /t/t7403-submodule-sync.sh
parent7c6eafa35af805578990e76b691ff7f1a25a3c57 (diff)
downloadgit-33f072f8910081b12780197a2a5423227e437af8.zip
git-33f072f8910081b12780197a2a5423227e437af8.tar.gz
git-33f072f8910081b12780197a2a5423227e437af8.tar.bz2
submodule sync: Update "submodule.<name>.url" for empty directories
If a submodule directory has not been filled by "git submodule update" yet, then "git submodule sync" must still update the super-project's configuration for submodule.<name>.url. This situation occurs when switching between branches with a module from different urls and other branches without the submodule. Signed-off-by: Andreas Köhler <andi5.py@gmx.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7403-submodule-sync.sh')
-rwxr-xr-xt/t7403-submodule-sync.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh
index 02522f9..e5b1953 100755
--- a/t/t7403-submodule-sync.sh
+++ b/t/t7403-submodule-sync.sh
@@ -23,7 +23,9 @@ test_expect_success setup '
git commit -m "submodule"
) &&
git clone super super-clone &&
- (cd super-clone && git submodule update --init)
+ (cd super-clone && git submodule update --init) &&
+ git clone super empty-clone &&
+ (cd empty-clone && git submodule init)
'
test_expect_success 'change submodule' '
@@ -64,4 +66,12 @@ test_expect_success '"git submodule sync" should update submodule URLs' '
)
'
+test_expect_success '"git submodule sync" should update submodule URLs if not yet cloned' '
+ (cd empty-clone &&
+ git pull &&
+ git submodule sync &&
+ test -d "$(git config submodule.submodule.url)"
+ )
+'
+
test_done