summaryrefslogtreecommitdiff
path: root/diff.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2017-08-17 10:27:28 -0700
committerJunio C Hamano <gitster@pobox.com>2017-08-17 14:38:22 -0700
commit08a8509e50e560e3d14adb05698efe9ff063bbd3 (patch)
tree07718f9632c9b1506ffe35953e7382e285d20f1d /diff.c
parentb3622a4ee94e4916cd05e6d96e41eeb36b941182 (diff)
downloadgit-08a8509e50e560e3d14adb05698efe9ff063bbd3.tar.gz
diff: retire sane_truncate_fnjc/diff-sane-truncate-no-more
Long time ago, 23707811 ("diff: do not chomp hunk-header in the middle of a character", 2008-01-02) introduced sane_truncate_line() helper function to trim the "function header" line that is shown at the end of the hunk header line, in order to avoid chomping it in the middle of a single UTF-8 character. It also added a facility to define a custom callback function to make it possible to extend it to non UTF-8 encodings. During the following 8 1/2 years, nobody found need for this custom callback facility. A custom callback function is a wrong design to use here anyway---if your contents need support for non UTF-8 encoding, you shouldn't have to write a custom function and recompile Git to plumb it in. A better approach would be to extend sane_truncate_line() function and have a new member in emit_callback to conditionally trigger it. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'diff.c')
-rw-r--r--diff.c5
1 files changed, 0 insertions, 5 deletions
diff --git a/diff.c b/diff.c
index 9c38258030..9c71201e9c 100644
--- a/diff.c
+++ b/diff.c
@@ -406,8 +406,6 @@ static struct diff_tempfile {
struct tempfile tempfile;
} diff_temp[2];
-typedef unsigned long (*sane_truncate_fn)(char *line, unsigned long len);
-
struct emit_callback {
int color_diff;
unsigned ws_rule;
@@ -415,7 +413,6 @@ struct emit_callback {
int blank_at_eof_in_postimage;
int lno_in_preimage;
int lno_in_postimage;
- sane_truncate_fn truncate;
const char **label_path;
struct diff_words_data *diff_words;
struct diff_options *opt;
@@ -1243,8 +1240,6 @@ static unsigned long sane_truncate_line(struct emit_callback *ecb, char *line, u
unsigned long allot;
size_t l = len;
- if (ecb->truncate)
- return ecb->truncate(line, len);
cp = line;
allot = l;
while (0 < l) {