Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2016-11-17 21:46:03 +0300
committerJunio C Hamano <gitster@pobox.com>2016-11-23 19:37:45 +0300
commit1aa73658405ad423127b3c14ac13e46f9ad0163a (patch)
tree41485ecd2c2eaf2e81a0d5cda9a45fcfed1c49c1 /t/t5531-deep-submodule-push.sh
parent250ab24ab3a35d5857855a2e00483dcd8867fdca (diff)
push: --dry-run updates submodules when --recurse-submodules=on-demand
This patch adds a test to illustrate how push run with --dry-run doesn't actually perform a dry-run when push is configured to push submodules on-demand. Instead all submodules which need to be pushed are actually pushed to their remotes while any updates for the superproject are performed as a dry-run. This is a bug and not the intended behaviour of a dry-run. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5531-deep-submodule-push.sh')
-rwxr-xr-xt/t5531-deep-submodule-push.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index 198ce84754..7840032ba8 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -427,7 +427,31 @@ test_expect_success 'push unpushable submodule recursively fails' '
cd submodule.git &&
git rev-parse master >../actual
) &&
+ test_when_finished git -C work reset --hard master^ &&
test_cmp expected actual
'
+test_expect_failure 'push --dry-run does not recursively update submodules' '
+ (
+ cd work/gar/bage &&
+ git checkout master &&
+ git rev-parse master >../../../expected_submodule &&
+ > junk9 &&
+ git add junk9 &&
+ git commit -m "Ninth junk" &&
+
+ # Go up to 'work' directory
+ cd ../.. &&
+ git checkout master &&
+ git rev-parse master >../expected_pub &&
+ git add gar/bage &&
+ git commit -m "Ninth commit for gar/bage" &&
+ git push --dry-run --recurse-submodules=on-demand ../pub.git master
+ ) &&
+ git -C submodule.git rev-parse master >actual_submodule &&
+ git -C pub.git rev-parse master >actual_pub &&
+ test_cmp expected_pub actual_pub &&
+ test_cmp expected_submodule actual_submodule
+'
+
test_done