diff options
author | Patrick Steinhardt <ps@pks.im> | 2017-10-13 13:11:59 +0200 |
---|---|---|
committer | Patrick Steinhardt <ps@pks.im> | 2018-06-22 09:50:07 +0200 |
commit | ab265a351044e724b6c9049f404e9de64c732130 (patch) | |
tree | 0e05cda01214b2a9d512cb797833058c8c491cc5 /src/commit.h | |
parent | 9ac79ecce24a2c65e91ee0c2b414fd606b26309f (diff) | |
download | libgit2-ab265a351044e724b6c9049f404e9de64c732130.tar.gz |
commit: implement function to parse raw data
Currently, parsing objects is strictly tied to having an ODB object
available. This makes it hard to parse an object when all that is
available is its raw object and size. Furthermore, hacking around that
limitation by directly creating an ODB structure either on stack or on
heap does not really work that well due to ODB objects being reference
counted and then automatically free'd when reaching a reference count of
zero.
Implement a function `git_commit__parse_raw` to parse a commit object
from a pair of `data` and `size`.
Diffstat (limited to 'src/commit.h')
-rw-r--r-- | src/commit.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/commit.h b/src/commit.h index 781809d70..9137a8fad 100644 --- a/src/commit.h +++ b/src/commit.h @@ -35,5 +35,6 @@ struct git_commit { void git_commit__free(void *commit); int git_commit__parse(void *commit, git_odb_object *obj); +int git_commit__parse_raw(void *commit, const char *data, size_t size); #endif |