From a08feb8ef0b66c3e7d398ee6169c607b8efb7c80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torsten=20B=C3=B6gershausen?= Date: Tue, 5 Apr 2016 21:23:54 +0200 Subject: correct blame for files commited with CRLF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git blame reports lines as not "Not Committed Yet" when they have CRLF in the index, CRLF in the worktree and core.autocrlf is true. Since commit c4805393 (autocrlf: Make it work also for un-normalized repositories, 2010-05-12), files that have CRLF in the index are not normalized at commit when core.autocrl is set. Add a call to read_cache() early in fake_working_tree_commit(), before calling convert_to_git(). Signed-off-by: Torsten Bögershausen Signed-off-by: Junio C Hamano --- builtin/blame.c | 1 + 1 file changed, 1 insertion(+) (limited to 'builtin') diff --git a/builtin/blame.c b/builtin/blame.c index 048ed53c2f..a5cabf79ea 100644 --- a/builtin/blame.c +++ b/builtin/blame.c @@ -2275,6 +2275,7 @@ static struct commit *fake_working_tree_commit(struct diff_options *opt, unsigned mode; struct strbuf msg = STRBUF_INIT; + read_cache(); time(&now); commit = alloc_commit_node(); commit->object.parsed = 1; -- cgit v1.2.3