summaryrefslogtreecommitdiff
path: root/src/commit_list.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2013-04-03 22:30:07 +0200
committerVicent Marti <tanoku@gmail.com>2013-04-22 16:50:50 +0200
commit8842c75f172ed94be4ad11521d4083e97d740785 (patch)
treee864a71de4ec4745a57057541f5e5366a53c84cc /src/commit_list.c
parentc4e91d4500bdd357fbf7378bc10648a482513fa6 (diff)
downloadlibgit2-8842c75f172ed94be4ad11521d4083e97d740785.tar.gz
What has science done.
Diffstat (limited to 'src/commit_list.c')
-rw-r--r--src/commit_list.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/commit_list.c b/src/commit_list.c
index 603dd754a..baabbbafb 100644
--- a/src/commit_list.c
+++ b/src/commit_list.c
@@ -100,12 +100,15 @@ git_commit_list_node *git_commit_list_pop(git_commit_list **stack)
return item;
}
-static int commit_quick_parse(git_revwalk *walk, git_commit_list_node *commit, git_rawobj *raw)
+static int commit_quick_parse(
+ git_revwalk *walk,
+ git_commit_list_node *commit,
+ uint8_t *buffer,
+ size_t buffer_len)
{
const size_t parent_len = strlen("parent ") + GIT_OID_HEXSZ + 1;
- unsigned char *buffer = raw->data;
- unsigned char *buffer_end = buffer + raw->len;
- unsigned char *parents_start, *committer_start;
+ uint8_t *buffer_end = buffer + buffer_len;
+ uint8_t *parents_start, *committer_start;
int i, parents = 0;
int commit_time;
@@ -182,11 +185,11 @@ int git_commit_list_parse(git_revwalk *walk, git_commit_list_node *commit)
if ((error = git_odb_read(&obj, walk->odb, &commit->oid)) < 0)
return error;
- if (obj->raw.type != GIT_OBJ_COMMIT) {
+ if (obj->cached.type != GIT_OBJ_COMMIT) {
giterr_set(GITERR_INVALID, "Object is no commit object");
error = -1;
} else
- error = commit_quick_parse(walk, commit, &obj->raw);
+ error = commit_quick_parse(walk, commit, obj->buffer, obj->cached.size);
git_odb_object_free(obj);
return error;