summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/push.c10
-rw-r--r--src/remote.c6
2 files changed, 5 insertions, 11 deletions
diff --git a/src/push.c b/src/push.c
index 6671da465..fb51383cb 100644
--- a/src/push.c
+++ b/src/push.c
@@ -632,12 +632,12 @@ int git_push_finish(git_push *push)
(error = do_push(push)) < 0)
return error;
- return 0;
-}
+ if (!push->unpack_ok) {
+ error = -1;
+ giterr_set(GITERR_NET, "unpacking the sent packfile failed on the remote");
+ }
-int git_push_unpack_ok(const git_push *push)
-{
- return push->unpack_ok;
+ return error;
}
int git_push_status_foreach(git_push *push,
diff --git a/src/remote.c b/src/remote.c
index 531912c64..dd9b17854 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -2160,12 +2160,6 @@ int git_remote_push(git_remote *remote, git_strarray *refspecs, const git_push_o
if ((error = git_push_finish(push)) < 0)
goto cleanup;
- if (!git_push_unpack_ok(push)) {
- error = -1;
- giterr_set(GITERR_NET, "error in the remote while trying to unpack");
- goto cleanup;
- }
-
if (cbs->push_update_reference &&
(error = git_push_status_foreach(push, cbs->push_update_reference, cbs->payload)) < 0)
goto cleanup;