Skip to content

Commit f537312

Browse files
committed
push: don't try to connect in finish
Push starts by connecting, don't try to connect again, just rely on the existing connection existing.
1 parent 240c195 commit f537312

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/push.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -476,9 +476,10 @@ int git_push_finish(git_push *push, const git_remote_callbacks *callbacks)
476476
{
477477
int error;
478478

479-
if (!git_remote_connected(push->remote) &&
480-
(error = git_remote__connect(push->remote, GIT_DIRECTION_PUSH, callbacks, &push->connection)) < 0)
481-
return error;
479+
if (!git_remote_connected(push->remote)) {
480+
git_error_set(GIT_ERROR_NET, "remote is disconnected");
481+
return -1;
482+
}
482483

483484
if ((error = filter_refs(push->remote)) < 0 ||
484485
(error = do_push(push, callbacks)) < 0)

0 commit comments

Comments
 (0)