summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2016-03-25 11:39:15 -0700
committerJunio C Hamano <gitster@pobox.com>2016-03-25 14:30:35 -0700
commitffdfdfa5aeb5e42d119231dc71acafd0b6a3da92 (patch)
tree4fd0b4d56ccb9a81f4fdf9b4fc185d30f049cc59
parent91b37258e3b3e5e6cba6bf897c0a73fc731c2849 (diff)
downloadgit-ffdfdfa5aeb5e42d119231dc71acafd0b6a3da92.tar.gz
submodule sync: test syncing one submodule
The current test suite doesn't cover syncing one module only. Instead of adding a new test, we can change existing tests to cover this part as well. Signed-off-by: Stefan Beller <sbeller@google.com>
-rwxr-xr-xt/t7403-submodule-sync.sh13
1 files changed, 9 insertions, 4 deletions
diff --git a/t/t7403-submodule-sync.sh b/t/t7403-submodule-sync.sh
index 79bc135bf6..5dde1233db 100755
--- a/t/t7403-submodule-sync.sh
+++ b/t/t7403-submodule-sync.sh
@@ -28,6 +28,9 @@ test_expect_success setup '
git submodule add ../submodule submodule &&
test_tick &&
git commit -m "submodule"
+ git submodule add ../submodule submodule2 &&
+ test_tick &&
+ git commit -m "second submodule"
) &&
git clone super super-clone &&
(
@@ -149,15 +152,16 @@ test_expect_success 'reset submodule URLs' '
reset_submodule_urls super-clone
'
-test_expect_success '"git submodule sync" should update submodule URLs - subdirectory' '
+test_expect_success '"git submodule sync" should update specified submodule URLs - subdirectory' '
(
cd super-clone &&
git pull --no-recurse-submodules &&
mkdir -p sub &&
cd sub &&
- git submodule sync >../../output
+ git submodule sync ../submodule >../../output
) &&
grep "\\.\\./submodule" output &&
+ ! grep submodule2 output &&
test -d "$(
cd super-clone/submodule &&
git config remote.origin.url
@@ -177,7 +181,7 @@ test_expect_success '"git submodule sync" should update submodule URLs - subdire
)
'
-test_expect_success '"git submodule sync --recursive" should update all submodule URLs - subdirectory' '
+test_expect_success '"git submodule sync --recursive" should update all specified submodule URLs - subdirectory' '
(
cd super-clone &&
(
@@ -186,9 +190,10 @@ test_expect_success '"git submodule sync --recursive" should update all submodul
) &&
mkdir -p sub &&
cd sub &&
- git submodule sync --recursive >../../output
+ git submodule sync --recursive ../submodule >../../output
) &&
grep "\\.\\./submodule/sub-submodule" output &&
+ ! grep submodule2 output &&
test -d "$(
cd super-clone/submodule &&
git config remote.origin.url