diff options
author | Jeff Smith <whydoubt@gmail.com> | 2017-05-24 00:15:37 -0500 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-05-25 13:08:23 +0900 |
commit | bd481de713cb59a57f5f988b9bc46550c954dc45 (patch) | |
tree | 9ffb3af28b05c08e58b2c3d4021f6c3f766f9984 /blame.c | |
parent | 09002f1b31482dfbd0f471cd3614d542ea7a77a4 (diff) | |
download | git-bd481de713cb59a57f5f988b9bc46550c954dc45.tar.gz |
blame: move entry prepend to libgit
Signed-off-by: Jeff Smith <whydoubt@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'blame.c')
-rw-r--r-- | blame.c | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -1845,3 +1845,19 @@ void setup_scoreboard(struct blame_scoreboard *sb, const char *path, struct blam if (orig) *orig = o; } + + + +struct blame_entry *blame_entry_prepend(struct blame_entry *head, + long start, long end, + struct blame_origin *o) +{ + struct blame_entry *new_head = xcalloc(1, sizeof(struct blame_entry)); + new_head->lno = start; + new_head->num_lines = end - start; + new_head->suspect = o; + new_head->s_lno = start; + new_head->next = head; + blame_origin_incref(o); + return new_head; +} |