@matheusbsbs / matheus-bagliano / commits / a79b8b6623
Fork 0

enable textconv for diff in verbose status/commit

This diff is meant for human consumption, so it makes sense to apply text conversion here, as we would for the regular diff porcelain. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Oct 26, 2008 at 00:50 UTC a79b8b6623288f7d5409ad749cc6553976a4f0e8
2 files changed +9
t/t4030-diff-textconv.sh
+8
@@ -76,6 +76,14 @@ test_expect_success 'format-patch produces binary' '
76 test_cmp expect.binary actual
77 '
78
79 +test_expect_success 'status -v produces text' '
80 + git reset --soft HEAD^ &&
81 + git status -v >diff &&
82 + find_diff <diff >actual &&
83 + test_cmp expect.text actual &&
84 + git reset --soft HEAD@{1}
85 +'
86 +
87 cat >expect.stat <<'EOF'
88 file | Bin 2 -> 4 bytes
89 1 files changed, 0 insertions(+), 0 deletions(-)
wt-status.c
+1
@@ -301,6 +301,7 @@ static void wt_status_print_verbose(struct wt_status *s)
301 setup_revisions(0, NULL, &rev, s->reference);
302 rev.diffopt.output_format |= DIFF_FORMAT_PATCH;
303 rev.diffopt.detect_rename = 1;
304 + DIFF_OPT_SET(&rev.diffopt, ALLOW_TEXTCONV);
305 rev.diffopt.file = s->fp;
306 rev.diffopt.close_file = 0;
307 /*