]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/blame.c
Merge branch 'rs/blame-optim'
[thirdparty/git.git] / builtin / blame.c
index b66e938022bc5fdf61d9910c274c08a79084648e..641523ff9af693bcbef8e77e66b3a5a607f7219f 100644 (file)
@@ -425,13 +425,11 @@ static void setup_default_color_by_age(void)
        parse_color_fields("blue,12 month ago,white,1 month ago,red");
 }
 
-static void determine_line_heat(struct blame_entry *ent, const char **dest_color)
+static void determine_line_heat(struct commit_info *ci, const char **dest_color)
 {
        int i = 0;
-       struct commit_info ci;
-       get_commit_info(ent->suspect->commit, &ci, 1);
 
-       while (i < colorfield_nr && ci.author_time > colorfield[i].hop)
+       while (i < colorfield_nr && ci->author_time > colorfield[i].hop)
                i++;
 
        *dest_color = colorfield[i].col;
@@ -453,7 +451,7 @@ static void emit_other(struct blame_scoreboard *sb, struct blame_entry *ent, int
        cp = blame_nth_line(sb, ent->lno);
 
        if (opt & OUTPUT_SHOW_AGE_WITH_COLOR) {
-               determine_line_heat(ent, &default_color);
+               determine_line_heat(&ci, &default_color);
                color = default_color;
                reset = GIT_COLOR_RESET;
        }