git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Gavrilov <angavrilov@gmail.com>
To: Git Mailing List <git@vger.kernel.org>
Cc: Junio C Hamano <gitster@pobox.com>,
	"Shawn O. Pearce" <spearce@spearce.org>
Subject: [RFC PATCH (BUG)] builtin-blame: Fix blame -C -C with submodules.
Date: Fri, 3 Oct 2008 20:23:50 +0400	[thread overview]
Message-ID: <200810032023.50559.angavrilov@gmail.com> (raw)

When performing copy detection, git-blame tries to
read gitlinks as blobs, which causes it to die.

This patch adds a check to skip them.

Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com>
---

	I don't know if this is enough for all cases, but it fixes mine.

	-- Alexander


	$ git blame --incremental -C -C ImpactMessages.cpp
	767f36d1ce2f361e9148bb23155e6aafad034f4b 6 6 10                      
	...
	767f36d1ce2f361e9148bb23155e6aafad034f4b 49 49 7                     
	filename BackEnd/Impact/ImpactMessages.cpp                           
	767f36d1ce2f361e9148bb23155e6aafad034f4b 57 57 1                     
	filename BackEnd/Impact/ImpactMessages.cpp                           
	767f36d1ce2f361e9148bb23155e6aafad034f4b 59 59 14                    
	filename BackEnd/Impact/ImpactMessages.cpp                           
	fatal: Cannot read blob 27152bb4f8b10d4ce5f9fa584c14511dceba3c06 for path BackEnd/Boost


 builtin-blame.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/builtin-blame.c b/builtin-blame.c
index 9bc901c..101c416 100644
--- a/builtin-blame.c
+++ b/builtin-blame.c
@@ -1136,6 +1136,8 @@ static int find_copy_in_parent(struct scoreboard *sb,
 
 			if (!DIFF_FILE_VALID(p->one))
 				continue; /* does not exist in parent */
+			if (S_ISGITLINK(p->one->mode))
+				continue; /* ignore git links */
 			if (porigin && !strcmp(p->one->path, porigin->path))
 				/* find_move already dealt with this path */
 				continue;
-- 
1.6.0.20.g6148bc

                 reply	other threads:[~2008-10-03 16:26 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200810032023.50559.angavrilov@gmail.com \
    --to=angavrilov@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=spearce@spearce.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).