summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorTay Ray Chuan <rctay89@gmail.com>2010-06-12 22:15:39 +0800
committerJunio C Hamano <gitster@pobox.com>2010-06-13 09:38:43 -0700
commita45e1a87adc7cd7ace911049829308ae97b2e914 (patch)
tree0c4a1efd3421e959f89627c76bad18314f3fc01f /t
parentcee9f2b37bd7c65de5fb507d11b4caac31c29039 (diff)
downloadgit-a45e1a87adc7cd7ace911049829308ae97b2e914.tar.gz
commit::print_summary(): don't use format_commit_message()
This attempts to fix a regression in git-commit, where non-abbreviated SHA-1s were printed in the summary. One possible fix would be to set ctx.abbrev to DEFAULT_ABBREV in the `if` block, where format_commit_message() is used. Instead, we do away with the format_commit_message() codeblock altogether, replacing it with a re-run of log_tree_commit(). We re-run log_tree_commit() with rev.always_show_header set, to force the invocation of show_log(). The effect of this flag can be seen from this excerpt from log-tree.c:560, the only area that rev.always_show_header is checked: shown = log_tree_diff(opt, commit, &log); if (!shown && opt->loginfo && opt->always_show_header) { log.parent = NULL; show_log(opt); shown = 1; } We also set rev.use_terminator, so that a newline is appended at the end of the log message. Note that callers in builtin/log.c that also set rev.always_show_header don't have to set rev.use_terminator, but still get a newline, because they are wrapped in a pager. Signed-off-by: Tay Ray Chuan <rctay89@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7502-commit.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t7502-commit.sh b/t/t7502-commit.sh
index b10541d4d3..08c0247ac3 100755
--- a/t/t7502-commit.sh
+++ b/t/t7502-commit.sh
@@ -36,12 +36,12 @@ test_expect_success 'output summary format' '
check_summary_oneline "" "a change"
'
-test_expect_failure 'output summary format for commit with an empty diff' '
+test_expect_success 'output summary format for commit with an empty diff' '
check_summary_oneline "" "empty" "--allow-empty"
'
-test_expect_failure 'output summary format for merges' '
+test_expect_success 'output summary format for merges' '
git checkout -b recursive-base &&
test_commit base file1 &&