diff options
author | Ben Straub <bs@github.com> | 2013-04-15 12:00:04 -0700 |
---|---|---|
committer | Ben Straub <bs@github.com> | 2013-04-15 12:00:04 -0700 |
commit | 299a224be16368dc36bef4dc3f5e711ce35300cd (patch) | |
tree | 5371b54270c4b84abd586c49d7eb06b80d3d4e7b /examples/diff.c | |
parent | 2ebc3c66c292539786b6ec1538f740c5e444fe16 (diff) | |
download | libgit2-299a224be16368dc36bef4dc3f5e711ce35300cd.tar.gz |
Change git_revparse to output git_object pointers
This will probably prevent many lookup/free
operations in calling code.
Diffstat (limited to 'examples/diff.c')
-rw-r--r-- | examples/diff.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/examples/diff.c b/examples/diff.c index 6fa0fee52..a977abd3f 100644 --- a/examples/diff.c +++ b/examples/diff.c @@ -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: |