From bd481de713cb59a57f5f988b9bc46550c954dc45 Mon Sep 17 00:00:00 2001 From: Jeff Smith Date: Wed, 24 May 2017 00:15:37 -0500 Subject: blame: move entry prepend to libgit Signed-off-by: Jeff Smith Signed-off-by: Junio C Hamano --- blame.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'blame.c') diff --git a/blame.c b/blame.c index f6c9cb7df..00404b973 100644 --- a/blame.c +++ b/blame.c @@ -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; +} -- cgit v1.2.1