{"thread":{"id":"15773","subject":"[RFC PATCH (BUG)] builtin-blame: Fix blame -C -C with submodules.","startedAt":"2008-10-03T16:23:50Z","lastAt":"2008-10-03T16:23:50Z","messageCount":1,"participants":["Alexander Gavrilov"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"92259","messageId":"200810032023.50559.angavrilov@gmail.com","threadId":"15773","inReplyTo":null,"subject":"[RFC PATCH (BUG)] builtin-blame: Fix blame -C -C with submodules.","fromName":"Alexander Gavrilov","fromEmail":"angavrilov@gmail.com","sentAt":"2008-10-03T16:23:50Z","receivedAt":"2008-10-03T16:23:50Z","isPatch":true,"sender":{"key":"angavrilov@gmail.com","avatar":"https://avatars.githubusercontent.com/u/42666?v=4"},"body":"When performing copy detection, git-blame tries to\nread gitlinks as blobs, which causes it to die.\n\nThis patch adds a check to skip them.\n\nSigned-off-by: Alexander Gavrilov <angavrilov@gmail.com>\n---\n\n\tI don't know if this is enough for all cases, but it fixes mine.\n\n\t-- Alexander\n\n\n\t$ git blame --incremental -C -C ImpactMessages.cpp\n\t767f36d1ce2f361e9148bb23155e6aafad034f4b 6 6 10                      \n\t...\n\t767f36d1ce2f361e9148bb23155e6aafad034f4b 49 49 7                     \n\tfilename BackEnd/Impact/ImpactMessages.cpp                           \n\t767f36d1ce2f361e9148bb23155e6aafad034f4b 57 57 1                     \n\tfilename BackEnd/Impact/ImpactMessages.cpp                           \n\t767f36d1ce2f361e9148bb23155e6aafad034f4b 59 59 14                    \n\tfilename BackEnd/Impact/ImpactMessages.cpp                           \n\tfatal: Cannot read blob 27152bb4f8b10d4ce5f9fa584c14511dceba3c06 for path BackEnd/Boost\n\n\n builtin-blame.c |    2 ++\n 1 files changed, 2 insertions(+), 0 deletions(-)\n\ndiff --git a/builtin-blame.c b/builtin-blame.c\nindex 9bc901c..101c416 100644\n--- a/builtin-blame.c\n+++ b/builtin-blame.c\n@@ -1136,6 +1136,8 @@ static int find_copy_in_parent(struct scoreboard *sb,\n \n \t\t\tif (!DIFF_FILE_VALID(p->one))\n \t\t\t\tcontinue; /* does not exist in parent */\n+\t\t\tif (S_ISGITLINK(p->one->mode))\n+\t\t\t\tcontinue; /* ignore git links */\n \t\t\tif (porigin && !strcmp(p->one->path, porigin->path))\n \t\t\t\t/* find_move already dealt with this path */\n \t\t\t\tcontinue;\n-- \n1.6.0.20.g6148bc\n"}]}