transport-helper: fix sync issue on crashes
commit3994e64d77d644df0f290f8bf5210ff0cb0adde2
authorFelipe Contreras <felipe.contreras@gmail.com>
Sat, 12 Apr 2014 20:33:32 +0000 (12 15:33 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 14 Apr 2014 21:03:33 +0000 (14 14:03 -0700)
treec96da81ffda04e1d72e6464589fae51cdc245c78
parent852e54bc0f8c7a478bf1f3a13b45fdfc6604aba7
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>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t5801-remote-helpers.sh
transport-helper.c