push: test that --recurse-submodules on command line overrides config
t5531 only checked that the push.recurseSubmodules config option was overridden by passing --recurse-submodules=check on the command line. Add new tests for overriding with --recurse-submodules=no, --no-recurse-submodules and --recurse-submodules=push too. Also correct minor typo in test commit message. Signed-off-by: Mike Crowe <mac@mcrowe.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Mike Crowe committed
Dec 3, 2015 at 13:10 UTC
f5c7cd9ecf2274547197fc8fc40564957fc9b99d
1 file changed
+28
-4
t/t5531-deep-submodule-push.sh
+28
-4
@@ -126,24 +126,48 @@ test_expect_success 'push succeeds if submodule commit not on remote but using o
126
)
127
'
128
129
-test_expect_success 'push fails if submodule commit not on remote using check from cmdline overriding config' '
129
+test_expect_success 'push recurse-submodules on command line overrides config' '
130
(
131
cd work/gar/bage &&
132
>recurse-check-on-command-line-overriding-config &&
133
git add recurse-check-on-command-line-overriding-config &&
134
- git commit -m "Recurse on command-line overridiing config junk"
134
+ git commit -m "Recurse on command-line overriding config junk"
135
) &&
136
(
137
cd work &&
138
git add gar/bage &&
139
git commit -m "Recurse on command-line overriding config for gar/bage" &&
140
+
141
+ # Ensure that we can override on-demand in the config
142
+ # to just check submodules
143
test_must_fail git -c push.recurseSubmodules=on-demand push --recurse-submodules=check ../pub.git master &&
144
# Check that the supermodule commit did not get there
145
git fetch ../pub.git &&
146
git diff --quiet FETCH_HEAD master^ &&
147
# Check that the submodule commit did not get there
145
- cd gar/bage &&
146
- git diff --quiet origin/master master^
148
+ (cd gar/bage && git diff --quiet origin/master master^) &&
149
+
150
+ # Ensure that we can override check in the config to
151
+ # disable submodule recursion entirely
152
+ (cd gar/bage && git diff --quiet origin/master master^) &&
153
+ git -c push.recurseSubmodules=on-demand push --recurse-submodules=no ../pub.git master &&
154
+ git fetch ../pub.git &&
155
+ git diff --quiet FETCH_HEAD master &&
156
+ (cd gar/bage && git diff --quiet origin/master master^) &&
157
+
158
+ # Ensure that we can override check in the config to
159
+ # disable submodule recursion entirely (alternative form)
160
+ git -c push.recurseSubmodules=on-demand push --no-recurse-submodules ../pub.git master &&
161
+ git fetch ../pub.git &&
162
+ git diff --quiet FETCH_HEAD master &&
163
+ (cd gar/bage && git diff --quiet origin/master master^) &&
164
+
165
+ # Ensure that we can override check in the config to
166
+ # push the submodule too
167
+ git -c push.recurseSubmodules=check push --recurse-submodules=on-demand ../pub.git master &&
168
+ git fetch ../pub.git &&
169
+ git diff --quiet FETCH_HEAD master &&
170
+ (cd gar/bage && git diff --quiet origin/master master)
171
)
172
'
173