Re: [PATCH v2 5/6] push: only ignore finish_connect() for dry-run mode
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Nov 25, 2024, 08:26 UTC
- Message-ID
- <Z0Q0ud0SJ8ZeEvXx@pks.im>
- In-Reply-To
- <1ad61a02955fca35c4d1763adfbac3fd36482e09.1731603991.git.zhiyou.jx@alibaba-inc.com>
On Fri, Nov 15, 2024 at 01:15:36AM +0800, Jiang Xin wrote:
Show 18 quoted lines
> diff --git a/transport.c b/transport.c > index 9e03a7148c..186d58e907 100644 > --- a/transport.c > +++ b/transport.c > @@ -923,10 +923,10 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re > close(data->fd[0]); > /* > * Atomic push may abort the connection early and close the pipe, > - * which may cause an error for `finish_connect()`. Ignore this error > - * for atomic git-push. > + * which may cause an error for `finish_connect()`. We can ignore > + * this error when both `--atomic` and `--dry-run` flags provided. > */ > - if (ret || args.atomic) > + if (ret || (args.atomic && args.dry_run)) > finish_connect(data->conn); > else > ret = finish_connect(data->conn);
In the same spirit as mentioned in other commits I don't think it is a good idea to condition this behaviour on "--dry-run".
Patrick