t7406: submodule.<name>.update command must not be run from .gitmodules
[gitweb.git] / t / t7406-submodule-update.sh
index 034914a14fd49fea07e8bff4802994fcd38807a9..6f083c4d68b677ff4058961311d6f753d3953a54 100755 (executable)
@@ -406,6 +406,14 @@ test_expect_success 'submodule update - command in .git/config' '
        )
 '
 
+test_expect_success 'submodule update - command in .gitmodules is ignored' '
+       test_when_finished "git -C super reset --hard HEAD^" &&
+       git -C super config -f .gitmodules submodule.submodule.update "!false" &&
+       git -C super commit -a -m "add command to .gitmodules file" &&
+       git -C super/submodule reset --hard $submodulesha1^ &&
+       git -C super submodule update submodule
+'
+
 cat << EOF >expect
 Execution of 'false $submodulesha1' failed in submodule path 'submodule'
 EOF