@@ -30,6 +30,7 @@ test_expect_success 'setup a submodule tree' '
30
30
git clone super submodule &&
31
31
git clone super rebasing &&
32
32
git clone super merging &&
33
+ git clone super none &&
33
34
(cd super &&
34
35
git submodule add ../submodule submodule &&
35
36
test_tick &&
@@ -58,6 +59,11 @@ test_expect_success 'setup a submodule tree' '
58
59
test_tick &&
59
60
git commit -m "rebasing"
60
61
)
62
+ (cd super &&
63
+ git submodule add ../none none &&
64
+ test_tick &&
65
+ git commit -m "none"
66
+ )
61
67
'
62
68
63
69
test_expect_success ' submodule update detaching the HEAD ' '
@@ -298,6 +304,62 @@ test_expect_success 'submodule update ignores update=rebase config for new submo
298
304
)
299
305
'
300
306
307
+ test_expect_success ' submodule init picks up update=none' '
308
+ (cd super &&
309
+ git config -f .gitmodules submodule.none.update none &&
310
+ git submodule init none &&
311
+ test "none" = "$(git config submodule.none.update)"
312
+ )
313
+ '
314
+
315
+ test_expect_success ' submodule update - update=none in .git/config' '
316
+ (cd super &&
317
+ git config submodule.submodule.update none &&
318
+ (cd submodule &&
319
+ git checkout master &&
320
+ compare_head
321
+ ) &&
322
+ git diff --raw | grep " submodule" &&
323
+ git submodule update &&
324
+ git diff --raw | grep " submodule" &&
325
+ (cd submodule &&
326
+ compare_head
327
+ ) &&
328
+ git config --unset submodule.submodule.update &&
329
+ git submodule update submodule
330
+ )
331
+ '
332
+
333
+ test_expect_success ' submodule update - update=none in .git/config but --checkout given' '
334
+ (cd super &&
335
+ git config submodule.submodule.update none &&
336
+ (cd submodule &&
337
+ git checkout master &&
338
+ compare_head
339
+ ) &&
340
+ git diff --raw | grep " submodule" &&
341
+ git submodule update --checkout &&
342
+ test_must_fail git diff --raw \| grep " submodule" &&
343
+ (cd submodule &&
344
+ test_must_fail compare_head
345
+ ) &&
346
+ git config --unset submodule.submodule.update
347
+ )
348
+ '
349
+
350
+ test_expect_success ' submodule update --init skips submodule with update=none' '
351
+ (cd super &&
352
+ git add .gitmodules &&
353
+ git commit -m ".gitmodules"
354
+ ) &&
355
+ git clone super cloned &&
356
+ (cd cloned &&
357
+ git submodule update --init &&
358
+ test -e submodule/.git &&
359
+ test_must_fail test -e none/.git
360
+ )
361
+ '
362
+
301
363
test_expect_success ' submodule update continues after checkout error' '
302
364
(cd super &&
303
365
git reset --hard HEAD &&
0 commit comments