submodule update: run custom update script for initial populating as well
[gitweb.git] / t / t7406-submodule-update.sh
index 64f322c4cc87493ebc060ae5837495563fe61958..8c086a429b8253871b652265390ff6ba47c7074d 100755 (executable)
@@ -424,6 +424,16 @@ test_expect_success 'submodule update - command in .git/config catches failure -
        test_i18ncmp actual expect
 '
 
+test_expect_success 'submodule update - command run for initial population of submodule' '
+       cat <<-\ EOF >expect
+       Execution of '\''false $submodulesha1'\'' failed in submodule path '\''submodule'\''
+       EOF &&
+       rm -rf super/submodule &&
+       test_must_fail git -C super submodule update >../actual &&
+       test_cmp expect actual &&
+       git -C super submodule update --checkout
+'
+
 cat << EOF >expect
 Execution of 'false $submodulesha1' failed in submodule path '../super/submodule'
 Failed to recurse into submodule path '../super'
@@ -476,6 +486,7 @@ test_expect_success 'submodule init picks up merge' '
 '
 
 test_expect_success 'submodule update --merge  - ignores --merge  for new submodules' '
+       test_config -C super submodule.submodule.update checkout &&
        (cd super &&
         rm -rf submodule &&
         git submodule update submodule &&
@@ -488,6 +499,7 @@ test_expect_success 'submodule update --merge  - ignores --merge  for new submod
 '
 
 test_expect_success 'submodule update --rebase - ignores --rebase for new submodules' '
+       test_config -C super submodule.submodule.update checkout &&
        (cd super &&
         rm -rf submodule &&
         git submodule update submodule &&