author | Jeff King <peff@peff.net> | |
Thu, 18 Oct 2007 06:19:15 +0000 (02:19 -0400) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Thu, 18 Oct 2007 07:45:59 +0000 (03:45 -0400) | ||
commit | 334f4831e5a779d42e521b770a26eae1ecb27e86 | |
tree | 2db439c432f6c9a2e276a2a1e2f355e4cc8c56a2 | tree | snapshot |
parent | de61e42b539ffbd28d2a2ba827bb0eb79767057b | commit | diff |
send-pack: don't update tracking refs on error
Previously, we updated the tracking refs (which match refs we
are pushing) while generating the list of refs to send.
However, at that point we don't know whether the refs were
accepted.
Instead, we now wait until we get a response code from the
server. If an error was indicated, we don't update any local
tracking refs. Technically some refs could have been updated
on the remote, but since the local ref update is just an
optimization to avoid an extra fetch, we are better off
erring on the side of correctness.
The user-visible message is now generated much later in the
program, and has been tweaked to make more sense.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Previously, we updated the tracking refs (which match refs we
are pushing) while generating the list of refs to send.
However, at that point we don't know whether the refs were
accepted.
Instead, we now wait until we get a response code from the
server. If an error was indicated, we don't update any local
tracking refs. Technically some refs could have been updated
on the remote, but since the local ref update is just an
optimization to avoid an extra fetch, we are better off
erring on the side of correctness.
The user-visible message is now generated much later in the
program, and has been tweaked to make more sense.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
send-pack.c | diff | blob | history |