summaryrefslogtreecommitdiff
path: root/t/t7508-status.sh
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2014-04-05 16:59:36 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-04-07 17:42:35 (GMT)
commitc215d3d2826c882feb819e5743287ec74d9ff693 (patch)
tree982b8ca3923d2b85feea648f7107114e44188bd8 /t/t7508-status.sh
parent1d2f393ac9bfb4c20f14d6ead7bb4c56e766ab77 (diff)
downloadgit-c215d3d2826c882feb819e5743287ec74d9ff693.zip
git-c215d3d2826c882feb819e5743287ec74d9ff693.tar.gz
git-c215d3d2826c882feb819e5743287ec74d9ff693.tar.bz2
commit -m: commit staged submodules regardless of ignore config
The previous commit fixed the problem that the staged but that ignored submodules did not show up in the status output of the commit command and weren't committed afterwards either. But when commit doesn't generate the status output (e.g. when used in a script with '-m') the ignored submodule will still not be committed. This is because in that case a different code path is taken which calls index_differs_from() instead of calling the wt_status functions. Fix that by calling index_differs_from() from builtin/commit.c with a diff_options argument value that tells it not ignore any submodule changes unless the '--ignore-submodules' option is used. Even though this option isn't yet implemented for cmd_commit() but only for cmd_status() this prepares cmd_commit() to correctly handle the '--ignore-submodules' option later. As status and commit share the same ignore_submodule_arg variable this makes the code more robust against accidental breakage and documents how to correctly call index_differs_from(). Change the expected result of the test documenting this problem from failure to success. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7508-status.sh')
-rwxr-xr-xt/t7508-status.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/t/t7508-status.sh b/t/t7508-status.sh
index e6483fc..d480069 100755
--- a/t/t7508-status.sh
+++ b/t/t7508-status.sh
@@ -1523,7 +1523,7 @@ EOF
test_i18ngrep "^M. sm" output
'
-test_expect_failure 'git commit -m will commit a staged but ignored submodule' '
+test_expect_success 'git commit -m will commit a staged but ignored submodule' '
git commit -uno -m message &&
git status -s --ignore-submodules=dirty >output &&
test_i18ngrep ! "^M. sm" output &&