Change git_revparse to output git_object pointers

This will probably prevent many lookup/free
operations in calling code.
This commit is contained in:
Ben Straub
2013-04-15 12:00:04 -07:00
parent 2ebc3c66c2
commit 299a224be1
10 changed files with 54 additions and 66 deletions

View File

@@ -15,12 +15,10 @@ static int resolve_to_tree(
git_repository *repo, const char *identifier, git_tree **tree)
{
int err = 0;
git_oid oid;
git_object *obj = NULL;
if (git_revparse(&oid, NULL, NULL, repo, identifier) < 0 ||
git_object_lookup(&obj, repo, &oid, GIT_OBJ_ANY) < 0)
return GIT_ENOTFOUND;
if ((err =git_revparse(&obj, NULL, NULL, repo, identifier)) < 0)
return err;
switch (git_object_type(obj)) {
case GIT_OBJ_TREE: