Respect core.autocrlf in combined diff
Fix git-diff to make it produce useful 3-way diffs for merge conflicts in repositories with autocrlf enabled. Otherwise it always reports that the whole file was changed, because it uses the contents from the working tree without necessary conversion. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
913e0e99b6
commit
5e568f9e30
@ -727,6 +727,18 @@ static void show_patch_diff(struct combine_diff_path *elem, int num_parent,
|
||||
die("early EOF '%s'", elem->path);
|
||||
|
||||
result[len] = 0;
|
||||
|
||||
/* If not a fake symlink, apply filters, e.g. autocrlf */
|
||||
if (is_file) {
|
||||
struct strbuf buf;
|
||||
|
||||
strbuf_init(&buf, 0);
|
||||
if (convert_to_git(elem->path, result, len, &buf, safe_crlf)) {
|
||||
free(result);
|
||||
result = strbuf_detach(&buf, &len);
|
||||
result_size = len;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
deleted_file:
|
||||
|
Reference in New Issue
Block a user