]> Pileus Git - ~andy/git/commitdiff
t7406: "git submodule update {--merge|--rebase]" with new submodules
authorSpencer E. Olson <olsonse@umich.edu>
Thu, 17 Feb 2011 16:18:46 +0000 (09:18 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 17 Feb 2011 20:25:17 +0000 (12:25 -0800)
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>
t/t7406-submodule-update.sh

index bfb4975e940e29edf3b06e5c074b8e963cfbbdcf..fa9d23aa31302f53cc1c39473492cf545ca5ae87 100755 (executable)
@@ -203,4 +203,56 @@ test_expect_success 'submodule init picks up merge' '
        )
 '
 
+test_expect_success 'submodule update --merge  - ignores --merge  for new submodules' '
+       (cd super &&
+        rm -rf submodule &&
+        git submodule update submodule &&
+        git status -s submodule >expect &&
+        rm -rf submodule &&
+        git submodule update --merge submodule &&
+        git status -s submodule >actual &&
+        test_cmp expect actual
+       )
+'
+
+test_expect_success 'submodule update --rebase - ignores --rebase for new submodules' '
+       (cd super &&
+        rm -rf submodule &&
+        git submodule update submodule &&
+        git status -s submodule >expect &&
+        rm -rf submodule &&
+        git submodule update --rebase submodule &&
+        git status -s submodule >actual &&
+        test_cmp expect actual
+       )
+'
+
+test_expect_success 'submodule update ignores update=merge config for new submodules' '
+       (cd super &&
+        rm -rf submodule &&
+        git submodule update submodule &&
+        git status -s submodule >expect &&
+        rm -rf submodule &&
+        git config submodule.submodule.update merge &&
+        git submodule update submodule &&
+        git status -s submodule >actual &&
+        git config --unset submodule.submodule.update &&
+        test_cmp expect actual
+       )
+'
+
+test_expect_success 'submodule update ignores update=rebase config for new submodules' '
+       (cd super &&
+        rm -rf submodule &&
+        git submodule update submodule &&
+        git status -s submodule >expect &&
+        rm -rf submodule &&
+        git config submodule.submodule.update rebase &&
+        git submodule update submodule &&
+        git status -s submodule >actual &&
+        git config --unset submodule.submodule.update &&
+        test_cmp expect actual
+       )
+'
+
 test_done