Skip to content

Commit b200021

Browse files
olsonsegitster
authored andcommitted
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 <[email protected]> Acked-by: Jens Lehmann <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1b4735d commit b200021

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

t/t7406-submodule-update.sh

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,4 +203,56 @@ test_expect_success 'submodule init picks up merge' '
203203
)
204204
'
205205

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+
206258
test_done

0 commit comments

Comments
 (0)