summaryrefslogtreecommitdiff
path: root/blame.h
diff options
context:
space:
mode:
authorJeff Smith <whydoubt@gmail.com>2017-05-24 05:15:33 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-05-25 04:08:22 (GMT)
commitf5dd754c36f7d9cc7dd4c3f1a22e0e4a557b2021 (patch)
tree1aaed09c905f168d3c02eda686df00f1f6b5be93 /blame.h
parentdc076ae5d9fe8c2fbf238b265c1bc1f6f089fd16 (diff)
downloadgit-f5dd754c36f7d9cc7dd4c3f1a22e0e4a557b2021.zip
git-f5dd754c36f7d9cc7dd4c3f1a22e0e4a557b2021.tar.gz
git-f5dd754c36f7d9cc7dd4c3f1a22e0e4a557b2021.tar.bz2
blame: move origin-related methods to libgit
Signed-off-by: Jeff Smith <whydoubt@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'blame.h')
-rw-r--r--blame.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/blame.h b/blame.h
index c064d92..49b685e 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 */