Skip to contentSkip to conversation

Teach core.autocrlf to 'git blame'

PATCH In review Marius Storm-Olsen 1 participant 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Teach core.autocrlf to 'git blame'

Pass the fake commit through convert_to_git, so that the file is adjusted for local line-ending convention.

---
Added missing signoff in the previous mail.

 builtin-blame.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
builtin-blame.c +1 -0
index e3112a2..8432b82 100644
@@ -2059,6 +2059,7 @@ static struct commit *fake_working_tree_commit(const char *path, const char *con
 		if (strbuf_read(&buf, 0, 0) < 0)
 			die("read error %s from stdin", strerror(errno));
 	}
+	convert_to_git(path, buf.buf, buf.len, &buf);
 	origin->file.ptr = buf.buf;
 	origin->file.size = buf.len;
 	pretend_sha1_file(buf.buf, buf.len, OBJ_BLOB, origin->blob_sha1);
Signature · 1 line
1.5.3.4.1155.gfe96ee-dirty
#1 lore raw

Just a reminder of this one, as I didn't see it any "What's in" reports, nor your http://repo.or.cz/w/git/spearce.git repo. (It's normal git.git patch, not an msysgit patch :-)

Signature · 3 lines
.marius

Marius Storm-Olsen said the following on 05.10.2007 14:13:
Quoted 22 lines

Pass the fake commit through convert_to_git, so that the file is adjusted for local line-ending convention.

---
Added missing signoff in the previous mail.

 builtin-blame.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
builtin-blame.c +1 -0
index e3112a2..8432b82 100644
@@ -2059,6 +2059,7 @@ static struct commit *fake_working_tree_commit(const char *path, const char *con
 		if (strbuf_read(&buf, 0, 0) < 0)
 			die("read error %s from stdin", strerror(errno));
 	}
+	convert_to_git(path, buf.buf, buf.len, &buf);
 	origin->file.ptr = buf.buf;
 	origin->file.size = buf.len;
 	pretend_sha1_file(buf.buf, buf.len, OBJ_BLOB, origin->blob_sha1);