commit - 6fcac4576a437f60e050eec706040bdb272eb058
commit + 06ca4d091887ecc59f63c7fa459c57e58122d31b
blob - e32dd4a6f55ae4f90e82a25f0190eb98da4c65ad
blob + 977d7f578441bc9814edefb94eb8001344b09deb
--- lib/blame.c
+++ lib/blame.c
struct got_blame {
FILE *f;
int nlines;
+ int nannotated;
struct got_blame_line *lines; /* one per line */
int ncommits;
struct got_blame_diff_offsets_list diff_offsets_list;
memcpy(&line->id, id, sizeof(line->id));
line->annotated = 1;
+ blame->nannotated++;
if (cb)
err = cb(arg, blame->nlines, lineno, id);
return err;
commit_id, cb, arg);
if (err)
return err;
+ if (blame->nlines == blame->nannotated)
+ return NULL;
}
}
err = NULL;
break;
}
+ if (blame->nannotated == blame->nlines)
+ break;
}
id = next_id;
}
- if (id) {
+ if (id && blame->nannotated < blame->nlines) {
/* Annotate remaining non-annotated lines with last commit. */
for (lineno = 1; lineno <= blame->nlines; lineno++) {
err = annotate_line(blame, lineno, id, cb, arg);