commit - ed77f2ae3c0b3d80baa937a627d7c7c55583337a
commit + d157810fc8eed7b3b5b84ea214e7d9d95863e7d0
blob - 45a62df5727ec9a18821e43e1ac83f19029fad66
blob + 933ef189e913efdb7831787569b32f5139f2eaea
--- lib/blame.c
+++ lib/blame.c
return NULL;
}
-static const struct got_error *
+static void
annotate_line(struct got_blame *blame, int lineno, struct got_object_id *id)
{
struct got_blame_line *line;
if (lineno < 1 || lineno > blame->nlines)
- return got_error(GOT_ERR_RANGE);
+ return;
line = &blame->lines[lineno - 1];
if (line->annotated)
- return NULL;
+ return;
memcpy(&line->id, id, sizeof(line->id));
line->annotated = 1;
- return NULL;
}
static const struct got_error *
int a = change->cv.a;
int b = change->cv.b;
int lineno;
- for (lineno = a; lineno <= b; lineno++) {
- err = annotate_line(blame, lineno, id);
- if (err)
- goto done;
- }
+ for (lineno = a; lineno <= b; lineno++)
+ annotate_line(blame, lineno, id);
}
free(id_str);
}
}
/* Annotate remaining non-annotated lines with last commit. */
- for (lineno = 1; lineno < blame->nlines; lineno++) {
- err = annotate_line(blame, lineno, id);
- if (err)
- break;
- }
+ for (lineno = 1; lineno < blame->nlines; lineno++)
+ annotate_line(blame, lineno, id);
done:
free(id);