summaryrefslogtreecommitdiff
path: root/src/git/commit.h
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2010-05-21 02:35:40 +0200
committerAndreas Ericsson <ae@op5.se>2010-06-02 10:32:06 +0200
commit8add01539268300564482f854412cfe9839e980c (patch)
treec620f25d7fb92598b819001c8265d0d324275546 /src/git/commit.h
parent08d5d00056a7237bf6c60f85a6e72b7549cf9133 (diff)
downloadlibgit2-8add01539268300564482f854412cfe9839e980c.tar.gz
Split git_commit_lookup into separate functions.
git_commit_lookup() now creates commit references without loading them from the ODB. git_commit_parse() creates a commit reference, loads it and parses it from the ODB. Signed-off-by: Vicent Marti <tanoku@gmail.com> Signed-off-by: Andreas Ericsson <ae@op5.se>
Diffstat (limited to 'src/git/commit.h')
-rw-r--r--src/git/commit.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/git/commit.h b/src/git/commit.h
index ea59a210d..1a57ba732 100644
--- a/src/git/commit.h
+++ b/src/git/commit.h
@@ -17,7 +17,17 @@ GIT_BEGIN_DECL
typedef struct git_commit git_commit;
/**
- * Lookup a commit from a revision pool, and parse it if needed.
+ * Locate a reference to a commit without loading it.
+ * @param pool the pool to use when locating the commit.
+ * @param id identity of the commit to locate. If the object is
+ * an annotated tag it will be peeled back to the commit.
+ * @return the commit; NULL if the commit could not be created
+ */
+GIT_EXTERN(git_commit *) git_commit_lookup(git_revpool *pool, const git_oid *id);
+
+/**
+ * Locate a reference to a commit, and try to load and parse it it from
+ * the commit cache or the object database.
* @param pool the pool to use when parsing/caching the commit.
* @param id identity of the commit to locate. If the object is
* an annotated tag it will be peeled back to the commit.
@@ -25,7 +35,7 @@ typedef struct git_commit git_commit;
* pool's git_odb, or if the commit is present but is
* too malformed to be parsed successfully.
*/
-GIT_EXTERN(git_commit *) git_commit_lookup(git_revpool *pool, const git_oid *id);
+GIT_EXTERN(git_commit *) git_commit_parse(git_revpool *pool, const git_oid *id);
/**
* Get the id of a commit.