transport-helper: fix sync issue on crashes felipec/fc/transport/crash-fix
authorFelipe Contreras <felipe.contreras@gmail.com>
Sat, 12 Apr 2014 16:48:33 +0000 (11:48 -0500)
committerFelipe Contreras <felipe.contreras@gmail.com>
Fri, 23 May 2014 23:45:09 +0000 (18:45 -0500)
commitd526c088ae1930b6e02f1ee4280dfe1643b5d6c6
tree042106c3e62197eef39ecec8ae4f5d5068f9b7d0
parent51747f65b8ad737b7289a1ce6e448db59c185747
transport-helper: fix sync issue on crashes

When a remote helper crashes while pushing we should revert back to the
state before the push, however, it's possible that `git fast-export`
already finished its job, and therefore has exported the marks already.

This creates a synchronization problem because from that moment on
`git fast-{import,export}` will have marks that the remote helper is not
aware of and all further commands fail (if those marks are referenced).

The fix is to tell `git fast-export` to export to a temporary file, and
only after the remote helper has finishes successfully, move to the
final destination.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
t/t5801-remote-helpers.sh
transport-helper.c