summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorMike Crowe <mac@mcrowe.com>2015-12-03 13:10:35 +0000
committerJunio C Hamano <gitster@pobox.com>2015-12-04 13:04:04 -0800
commitd34141cd08fb1c6938eae329a7c3122b05e9eb01 (patch)
tree034d33dc8213b41628a010a0ac09abc98732c496 /t
parentf5c7cd9ecf2274547197fc8fc40564957fc9b99d (diff)
downloadgit-d34141cd08fb1c6938eae329a7c3122b05e9eb01.tar.gz
push: follow the "last one wins" convention for --recurse-submodulesmc/push-recurse-submodules-config
Use the "last one wins" convention for --recurse-submodules rather than treating conflicting options as an error. Also, fix the declaration of the file-scope recurse_submodules global variable to put it on a separate line. Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5531-deep-submodule-push.sh41
1 files changed, 41 insertions, 0 deletions
diff --git a/t/t5531-deep-submodule-push.sh b/t/t5531-deep-submodule-push.sh
index 721be32b02..198ce84754 100755
--- a/t/t5531-deep-submodule-push.sh
+++ b/t/t5531-deep-submodule-push.sh
@@ -171,6 +171,47 @@ test_expect_success 'push recurse-submodules on command line overrides config' '
)
'
+test_expect_success 'push recurse-submodules last one wins on command line' '
+ (
+ cd work/gar/bage &&
+ >recurse-check-on-command-line-overriding-earlier-command-line &&
+ git add recurse-check-on-command-line-overriding-earlier-command-line &&
+ git commit -m "Recurse on command-line overridiing earlier command-line junk"
+ ) &&
+ (
+ cd work &&
+ git add gar/bage &&
+ git commit -m "Recurse on command-line overriding earlier command-line for gar/bage" &&
+
+ # should result in "check"
+ test_must_fail git push --recurse-submodules=on-demand --recurse-submodules=check ../pub.git master &&
+ # Check that the supermodule commit did not get there
+ git fetch ../pub.git &&
+ git diff --quiet FETCH_HEAD master^ &&
+ # Check that the submodule commit did not get there
+ (cd gar/bage && git diff --quiet origin/master master^) &&
+
+ # should result in "no"
+ git push --recurse-submodules=on-demand --recurse-submodules=no ../pub.git master &&
+ # Check that the supermodule commit did get there
+ git fetch ../pub.git &&
+ git diff --quiet FETCH_HEAD master &&
+ # Check that the submodule commit did not get there
+ (cd gar/bage && git diff --quiet origin/master master^) &&
+
+ # should result in "no"
+ git push --recurse-submodules=on-demand --no-recurse-submodules ../pub.git master &&
+ # Check that the submodule commit did not get there
+ (cd gar/bage && git diff --quiet origin/master master^) &&
+
+ # But the options in the other order should push the submodule
+ git push --recurse-submodules=check --recurse-submodules=on-demand ../pub.git master &&
+ # Check that the submodule commit did get there
+ git fetch ../pub.git &&
+ (cd gar/bage && git diff --quiet origin/master master)
+ )
+'
+
test_expect_success 'push succeeds if submodule commit not on remote using on-demand from cmdline overriding config' '
(
cd work/gar/bage &&