From f5dd754c36f7d9cc7dd4c3f1a22e0e4a557b2021 Mon Sep 17 00:00:00 2001 From: Jeff Smith Date: Wed, 24 May 2017 00:15:33 -0500 Subject: blame: move origin-related methods to libgit Signed-off-by: Jeff Smith Signed-off-by: Junio C Hamano --- blame.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'blame.h') diff --git a/blame.h b/blame.h index c064d929b7..49b685e0fd 100644 --- a/blame.h +++ b/blame.h @@ -140,4 +140,19 @@ struct blame_scoreboard { void *found_guilty_entry_data; }; +/* + * Origin is refcounted and usually we keep the blob contents to be + * reused. + */ +static inline struct blame_origin *blame_origin_incref(struct blame_origin *o) +{ + if (o) + o->refcnt++; + return o; +} +extern void blame_origin_decref(struct blame_origin *o); + +extern struct blame_origin *make_origin(struct commit *commit, const char *path); +extern struct blame_origin *get_origin(struct commit *commit, const char *path); + #endif /* BLAME_H */ -- cgit v1.2.1