diff options
Diffstat (limited to 'transport-helper.c')
-rw-r--r-- | transport-helper.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/transport-helper.c b/transport-helper.c index b573b6c730..4cd76366fa 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -745,13 +745,13 @@ static int push_update_ref_status(struct strbuf *buf, die(_("'option' without a matching 'ok/error' directive")); if (state->new_report) { if (!state->hint->report) { - state->hint->report = xcalloc(1, sizeof(struct ref_push_report)); + CALLOC_ARRAY(state->hint->report, 1); state->report = state->hint->report; } else { state->report = state->hint->report; while (state->report->next) state->report = state->report->next; - state->report->next = xcalloc(1, sizeof(struct ref_push_report)); + CALLOC_ARRAY(state->report->next, 1); state->report = state->report->next; } state->new_report = 0; @@ -827,6 +827,10 @@ static int push_update_ref_status(struct strbuf *buf, status = REF_STATUS_REJECT_STALE; FREE_AND_NULL(msg); } + else if (!strcmp(msg, "remote ref updated since checkout")) { + status = REF_STATUS_REJECT_REMOTE_UPDATED; + FREE_AND_NULL(msg); + } else if (!strcmp(msg, "forced update")) { forced = 1; FREE_AND_NULL(msg); @@ -934,6 +938,11 @@ static void set_common_push_options(struct transport *transport, if (set_helper_option(transport, TRANS_OPT_ATOMIC, "true") != 0) die(_("helper %s does not support --atomic"), name); + if (flags & TRANSPORT_PUSH_FORCE_IF_INCLUDES) + if (set_helper_option(transport, TRANS_OPT_FORCE_IF_INCLUDES, "true") != 0) + die(_("helper %s does not support --%s"), + name, TRANS_OPT_FORCE_IF_INCLUDES); + if (flags & TRANSPORT_PUSH_OPTIONS) { struct string_list_item *item; for_each_string_list_item(item, transport->push_options) @@ -967,6 +976,7 @@ static int push_refs_with_push(struct transport *transport, case REF_STATUS_REJECT_NONFASTFORWARD: case REF_STATUS_REJECT_STALE: case REF_STATUS_REJECT_ALREADY_EXISTS: + case REF_STATUS_REJECT_REMOTE_UPDATED: if (atomic) { reject_atomic_push(remote_refs, mirror); string_list_clear(&cas_options, 0); @@ -1152,13 +1162,14 @@ static int has_attribute(const char *attrs, const char *attr) } static struct ref *get_refs_list(struct transport *transport, int for_push, - const struct strvec *ref_prefixes) + struct transport_ls_refs_options *transport_options) { get_helper(transport); if (process_connect(transport, for_push)) { do_take_over(transport); - return transport->vtable->get_refs_list(transport, for_push, ref_prefixes); + return transport->vtable->get_refs_list(transport, for_push, + transport_options); } return get_refs_list_using_list(transport, for_push); |