summaryrefslogtreecommitdiff
path: root/src/commit.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2018-08-26 11:26:45 +0100
committerGitHub <noreply@github.com>2018-08-26 11:26:45 +0100
commit50186ce88bcca5d7a23d6365acb3e9a818474f6f (patch)
tree3d8d98da06557dc2a3bf759943e038bc69a26b4e /src/commit.c
parent8856337b35ad417db9fa5604f76086528cb0436b (diff)
parent261267e0f1d36435e3832c4988cb2298b68dc7c2 (diff)
downloadlibgit2-50186ce88bcca5d7a23d6365acb3e9a818474f6f.tar.gz
Merge pull request #4374 from pks-t/pks/pack-file-verify
Pack file verification
Diffstat (limited to 'src/commit.c')
-rw-r--r--src/commit.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/commit.c b/src/commit.c
index e0ba51d47..97ac2a189 100644
--- a/src/commit.c
+++ b/src/commit.c
@@ -383,11 +383,11 @@ int git_commit_amend(
return error;
}
-int git_commit__parse(void *_commit, git_odb_object *odb_obj)
+int git_commit__parse_raw(void *_commit, const char *data, size_t size)
{
git_commit *commit = _commit;
- const char *buffer_start = git_odb_object_data(odb_obj), *buffer;
- const char *buffer_end = buffer_start + git_odb_object_size(odb_obj);
+ const char *buffer_start = data, *buffer;
+ const char *buffer_end = buffer_start + size;
git_oid parent_id;
size_t header_len;
git_signature dummy_sig;
@@ -477,6 +477,13 @@ bad_buffer:
return -1;
}
+int git_commit__parse(void *_commit, git_odb_object *odb_obj)
+{
+ return git_commit__parse_raw(_commit,
+ git_odb_object_data(odb_obj),
+ git_odb_object_size(odb_obj));
+}
+
#define GIT_COMMIT_GETTER(_rvalue, _name, _return) \
_rvalue git_commit_##_name(const git_commit *commit) \
{\