Skip to content

Commit ac8f6b6

Browse files
committed
Merge branch 'rs/commit-summary-wo-break-rewrite' into maint
The commit summary shown after making a commit is matched to what is given in "git status" not to use the break-rewrite heuristics. source: <[email protected]> * rs/commit-summary-wo-break-rewrite: commit, sequencer: turn off break_opt for commit summary
2 parents a5a5273 + 8479232 commit ac8f6b6

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

sequencer.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1327,7 +1327,6 @@ void print_commit_summary(struct repository *r,
13271327
get_commit_format(format.buf, &rev);
13281328
rev.always_show_header = 0;
13291329
rev.diffopt.detect_rename = DIFF_DETECT_RENAME;
1330-
rev.diffopt.break_opt = 0;
13311330
diff_setup_done(&rev.diffopt);
13321331

13331332
refs = get_main_ref_store(the_repository);

t/t7524-commit-summary.sh

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/bin/sh
2+
3+
test_description='git commit summary'
4+
. ./test-lib.sh
5+
6+
test_expect_success 'setup' '
7+
test_seq 101 200 >file &&
8+
git add file &&
9+
git commit -m initial &&
10+
git tag initial
11+
'
12+
13+
test_expect_success 'commit summary ignores rewrites' '
14+
git reset --hard initial &&
15+
test_seq 200 300 >file &&
16+
17+
git diff --stat >diffstat &&
18+
git diff --stat --break-rewrites >diffstatrewrite &&
19+
20+
# make sure this scenario is a detectable rewrite
21+
! test_cmp_bin diffstat diffstatrewrite &&
22+
23+
git add file &&
24+
git commit -m second >actual &&
25+
26+
grep "1 file" <actual >actual.total &&
27+
grep "1 file" <diffstat >diffstat.total &&
28+
test_cmp diffstat.total actual.total
29+
'
30+
31+
test_done

0 commit comments

Comments
 (0)