summaryrefslogtreecommitdiff
path: root/include/git2/commit.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/git2/commit.h')
-rw-r--r--include/git2/commit.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/git2/commit.h b/include/git2/commit.h
index 8306eb152..d497324c6 100644
--- a/include/git2/commit.h
+++ b/include/git2/commit.h
@@ -54,6 +54,23 @@ GIT_INLINE(int) git_commit_lookup(git_commit **commit, git_repository *repo, con
}
/**
+ * Close an open commit
+ *
+ * This is a wrapper around git_object_close()
+ *
+ * IMPORTANT:
+ * It *is* necessary to call this method when you stop
+ * using a commit. Failure to do so will cause a memory leak.
+ *
+ * @param commit the commit to close
+ */
+
+GIT_INLINE(void) git_commit_close(git_commit *commit)
+{
+ return git_object_close((git_object *) commit);
+}
+
+/**
* Get the id of a commit.
*
* @param commit a previously loaded commit.