transport-helper: don't update refs in dry-run

The remote helper namespace should not be updated. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Felipe Contreras committed Oct 31, 2013 at 03:36 UTC 5a75353fe381b344a33d7a89f7803e4a24d2ddcf
1 file changed +5 -4
transport-helper.c
+5 -4
@@ -727,7 +727,8 @@ static int push_update_ref_status(struct strbuf *buf,
727 }
728
729 static void push_update_refs_status(struct helper_data *data,
730 - struct ref *remote_refs)
730 + struct ref *remote_refs,
731 + int flags)
732 {
733 struct strbuf buf = STRBUF_INIT;
734 struct ref *ref = remote_refs;
@@ -741,7 +742,7 @@ static void push_update_refs_status(struct helper_data *data,
742 if (push_update_ref_status(&buf, &ref, remote_refs))
743 continue;
744
744 - if (!data->refspecs || data->no_private_update)
745 + if (flags & TRANSPORT_PUSH_DRY_RUN || !data->refspecs || data->no_private_update)
746 continue;
747
748 /* propagate back the update to the remote namespace */
@@ -832,7 +833,7 @@ static int push_refs_with_push(struct transport *transport,
833 sendline(data, &buf);
834 strbuf_release(&buf);
835
835 - push_update_refs_status(data, remote_refs);
836 + push_update_refs_status(data, remote_refs, flags);
837 return 0;
838 }
839
@@ -886,7 +887,7 @@ static int push_refs_with_export(struct transport *transport,
887
888 if (finish_command(&exporter))
889 die("Error while running fast-export");
889 - push_update_refs_status(data, remote_refs);
890 + push_update_refs_status(data, remote_refs, flags);
891 return 0;
892 }
893