t7406: "git submodule update {--merge|--rebase]" with new submodules
Add two test cases in t7406 to ensure that the --merge/--rebase options are ignored for "git submodule update" with new modules. These test that a simple checkout is performed instead. Signed-off-by: Spencer E. Olson <olsonse@umich.edu> Acked-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Spencer E. Olson committed
Feb 17, 2011 at 09:18 UTC
b200021e150320459d4f1edf1099131e0f5ae297
1 file changed
+52
t/t7406-submodule-update.sh
+52
@@ -203,4 +203,56 @@ test_expect_success 'submodule init picks up merge' '
203
)
204
'
205
206
+test_expect_success 'submodule update --merge - ignores --merge for new submodules' '
207
+ (cd super &&
208
+ rm -rf submodule &&
209
+ git submodule update submodule &&
210
+ git status -s submodule >expect &&
211
+ rm -rf submodule &&
212
+ git submodule update --merge submodule &&
213
+ git status -s submodule >actual &&
214
+ test_cmp expect actual
215
+ )
216
+'
217
+
218
+test_expect_success 'submodule update --rebase - ignores --rebase for new submodules' '
219
+ (cd super &&
220
+ rm -rf submodule &&
221
+ git submodule update submodule &&
222
+ git status -s submodule >expect &&
223
+ rm -rf submodule &&
224
+ git submodule update --rebase submodule &&
225
+ git status -s submodule >actual &&
226
+ test_cmp expect actual
227
+ )
228
+'
229
+
230
+test_expect_success 'submodule update ignores update=merge config for new submodules' '
231
+ (cd super &&
232
+ rm -rf submodule &&
233
+ git submodule update submodule &&
234
+ git status -s submodule >expect &&
235
+ rm -rf submodule &&
236
+ git config submodule.submodule.update merge &&
237
+ git submodule update submodule &&
238
+ git status -s submodule >actual &&
239
+ git config --unset submodule.submodule.update &&
240
+ test_cmp expect actual
241
+ )
242
+'
243
+
244
+test_expect_success 'submodule update ignores update=rebase config for new submodules' '
245
+ (cd super &&
246
+ rm -rf submodule &&
247
+ git submodule update submodule &&
248
+ git status -s submodule >expect &&
249
+ rm -rf submodule &&
250
+ git config submodule.submodule.update rebase &&
251
+ git submodule update submodule &&
252
+ git status -s submodule >actual &&
253
+ git config --unset submodule.submodule.update &&
254
+ test_cmp expect actual
255
+ )
256
+'
257
+
258
test_done