gitweb: Fix Atom feed <logo>: it is $logo, not $logo_url
[gitweb.git] / builtin-blame.c
index 16660221c30b0e3b1e1bd4cbc5559e3f162ae05a..dc3ffeaff82377262f0ae47993cf0883b2552092 100644 (file)
@@ -1407,7 +1407,8 @@ static int read_ancestry(const char *graft_file)
                /* The format is just "Commit Parent1 Parent2 ...\n" */
                int len = strlen(buf);
                struct commit_graft *graft = read_graft_line(buf, len);
-               register_commit_graft(graft, 0);
+               if (graft)
+                       register_commit_graft(graft, 0);
        }
        fclose(fp);
        return 0;
@@ -1434,14 +1435,14 @@ static void find_alignment(struct scoreboard *sb, int *option)
                struct commit_info ci;
                int num;
 
+               if (strcmp(suspect->path, sb->path))
+                       *option |= OUTPUT_SHOW_NAME;
+               num = strlen(suspect->path);
+               if (longest_file < num)
+                       longest_file = num;
                if (!(suspect->commit->object.flags & METAINFO_SHOWN)) {
                        suspect->commit->object.flags |= METAINFO_SHOWN;
                        get_commit_info(suspect->commit, &ci, 1);
-                       if (strcmp(suspect->path, sb->path))
-                               *option |= OUTPUT_SHOW_NAME;
-                       num = strlen(suspect->path);
-                       if (longest_file < num)
-                               longest_file = num;
                        num = strlen(ci.author);
                        if (longest_author < num)
                                longest_author = num;
@@ -1786,6 +1787,7 @@ int cmd_blame(int argc, const char **argv, const char *prefix)
        /* Now we got rev and path.  We do not want the path pruning
         * but we may want "bottom" processing.
         */
+       argv[unk++] = "--"; /* terminate the rev name */
        argv[unk] = NULL;
 
        init_revisions(&revs, NULL);