From 1aa21fe3b87a1e601023f49c41fab3ce76c189ac Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Tue, 9 Apr 2013 05:03:51 +0400 Subject: Deprecate git_revparse_single and _rangelike --- src/push.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) (limited to 'src/push.c') diff --git a/src/push.c b/src/push.c index 37f641812..dcd8122d1 100644 --- a/src/push.c +++ b/src/push.c @@ -96,21 +96,18 @@ static int check_rref(char *ref) static int check_lref(git_push *push, char *ref) { /* lref must be resolvable to an existing object */ - git_object *obj; - int error = git_revparse_single(&obj, push->repo, ref); - - if (error) { - if (error == GIT_ENOTFOUND) - giterr_set(GITERR_REFERENCE, - "src refspec '%s' does not match any existing object", ref); - else - giterr_set(GITERR_INVALID, "Not a valid reference '%s'", ref); + git_oid oid; + int error = git_revparse(&oid, NULL, NULL, push->repo, ref); - return -1; - } else - git_object_free(obj); + if (!error) + return 0; - return 0; + if (error == GIT_ENOTFOUND) + giterr_set(GITERR_REFERENCE, + "src refspec '%s' does not match any existing object", ref); + else + giterr_set(GITERR_INVALID, "Not a valid reference '%s'", ref); + return -1; } static int parse_refspec(git_push *push, push_spec **spec, const char *str) -- cgit v1.2.3 From 2ebc3c66c292539786b6ec1538f740c5e444fe16 Mon Sep 17 00:00:00 2001 From: Ben Straub Date: Mon, 15 Apr 2013 11:57:24 -0700 Subject: Redeploy git_revparse_single. --- src/push.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/push.c') diff --git a/src/push.c b/src/push.c index dcd8122d1..ce7af3598 100644 --- a/src/push.c +++ b/src/push.c @@ -96,8 +96,9 @@ static int check_rref(char *ref) static int check_lref(git_push *push, char *ref) { /* lref must be resolvable to an existing object */ - git_oid oid; - int error = git_revparse(&oid, NULL, NULL, push->repo, ref); + git_object *obj; + int error = git_revparse_single(&obj, push->repo, ref); + git_object_free(obj); if (!error) return 0; -- cgit v1.2.3