Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2013-04-15 23:00:04 +0400
committerBen Straub <bs@github.com>2013-04-15 23:00:04 +0400
commit299a224be16368dc36bef4dc3f5e711ce35300cd (patch)
tree5371b54270c4b84abd586c49d7eb06b80d3d4e7b /src/revwalk.c
parent2ebc3c66c292539786b6ec1538f740c5e444fe16 (diff)
Change git_revparse to output git_object pointers
This will probably prevent many lookup/free operations in calling code.
Diffstat (limited to 'src/revwalk.c')
-rw-r--r--src/revwalk.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/revwalk.c b/src/revwalk.c
index b22fef07f..05e99c0b6 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -231,7 +231,7 @@ int git_revwalk_push_ref(git_revwalk *walk, const char *refname)
int git_revwalk_push_range(git_revwalk *walk, const char *range)
{
- git_oid left, right;
+ git_object *left, *right;
git_revparse_flag_t revparseflags;
int error = 0;
@@ -243,11 +243,13 @@ int git_revwalk_push_range(git_revwalk *walk, const char *range)
return GIT_EINVALIDSPEC;
}
- if ((error = push_commit(walk, &left, 1)))
+ if ((error = push_commit(walk, git_object_id(left), 1)))
goto out;
- error = push_commit(walk, &right, 0);
+ error = push_commit(walk, git_object_id(right), 0);
out:
+ git_object_free(left);
+ git_object_free(right);
return error;
}