summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-12-17 19:47:18 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-12-17 19:47:18 (GMT)
commit14a9c5f261bcc436b80700076257f02af0beec68 (patch)
tree43f071ef531aaecba55cf73753711f89565aeb05 /t
parent433a30d0ba6e6d258be099859fa98d0205b25634 (diff)
parent1a72cfd7fa88e5a6c2b94568ac2fe69dfbd87f87 (diff)
downloadgit-14a9c5f261bcc436b80700076257f02af0beec68.zip
git-14a9c5f261bcc436b80700076257f02af0beec68.tar.gz
git-14a9c5f261bcc436b80700076257f02af0beec68.tar.bz2
Merge branch 'jl/commit-v-strip-marker'
"git commit -v" appends the patch to the log message before editing, and then removes the patch when the editor returned control. However, the patch was not stripped correctly when the first modified path was a submodule. * jl/commit-v-strip-marker: commit -v: strip diffs and submodule shortlogs from the commit message
Diffstat (limited to 't')
-rwxr-xr-xt/t7507-commit-verbose.sh28
1 files changed, 27 insertions, 1 deletions
diff --git a/t/t7507-commit-verbose.sh b/t/t7507-commit-verbose.sh
index da5bd3b..2ddf28c 100755
--- a/t/t7507-commit-verbose.sh
+++ b/t/t7507-commit-verbose.sh
@@ -65,9 +65,35 @@ test_expect_success 'diff in message is retained without -v' '
check_message diff
'
-test_expect_failure 'diff in message is retained with -v' '
+test_expect_success 'diff in message is retained with -v' '
git commit --amend -F diff -v &&
check_message diff
'
+test_expect_success 'submodule log is stripped out too with -v' '
+ git config diff.submodule log &&
+ git submodule add ./. sub &&
+ git commit -m "sub added" &&
+ (
+ cd sub &&
+ echo "more" >>file &&
+ git commit -a -m "submodule commit"
+ ) &&
+ (
+ GIT_EDITOR=cat &&
+ export GIT_EDITOR &&
+ test_must_fail git commit -a -v 2>err
+ ) &&
+ test_i18ngrep "Aborting commit due to empty commit message." err
+'
+
+test_expect_success 'verbose diff is stripped out with set core.commentChar' '
+ (
+ GIT_EDITOR=cat &&
+ export GIT_EDITOR &&
+ test_must_fail git -c core.commentchar=";" commit -a -v 2>err
+ ) &&
+ test_i18ngrep "Aborting commit due to empty commit message." err
+'
+
test_done