mirror of
https://github.com/libgit2/libgit2.git
synced 2026-06-22 06:26:26 +00:00
Change git_revparse to output git_object pointers
This will probably prevent many lookup/free operations in calling code.
This commit is contained in:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user