diff options
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: |