transport: remove transport_verify_remote_names

Remove 'transprot_verify_remote_names()' because all callers have migrated to using 'struct refspec' which performs the same checks in 'parse_refspec()'. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Williams committed May 16, 2018 at 15:58 UTC 7a78a82b6c3bb2a6ebaddf3354b6d97939bdb2ab
3 files changed -28
builtin/send-pack.c
-2
@@ -265,8 +265,6 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
265 BUG("unknown protocol version");
266 }
267
268 - transport_verify_remote_names(rs.raw_nr, rs.raw);
269 -
268 local_refs = get_local_heads();
269
270 flags = MATCH_REFS_NONE;
transport.c
-24
@@ -619,29 +619,6 @@ void transport_print_push_status(const char *dest, struct ref *refs,
619 free(head);
620 }
621
622 -void transport_verify_remote_names(int nr_heads, const char **heads)
623 -{
624 - int i;
625 -
626 - for (i = 0; i < nr_heads; i++) {
627 - const char *local = heads[i];
628 - const char *remote = strrchr(heads[i], ':');
629 -
630 - if (*local == '+')
631 - local++;
632 -
633 - /* A matching refspec is okay. */
634 - if (remote == local && remote[1] == '\0')
635 - continue;
636 -
637 - remote = remote ? (remote + 1) : local;
638 - if (check_refname_format(remote,
639 - REFNAME_ALLOW_ONELEVEL|REFNAME_REFSPEC_PATTERN))
640 - die("remote part of refspec is not a valid name in %s",
641 - heads[i]);
642 - }
643 -}
644 -
622 static int git_transport_push(struct transport *transport, struct ref *remote_refs, int flags)
623 {
624 struct git_transport_data *data = transport->data;
@@ -1097,7 +1074,6 @@ int transport_push(struct transport *transport,
1074 unsigned int *reject_reasons)
1075 {
1076 *reject_reasons = 0;
1100 - transport_verify_remote_names(rs->raw_nr, rs->raw);
1077
1078 if (transport_color_config() < 0)
1079 return -1;
transport.h
-2
@@ -227,8 +227,6 @@ int transport_helper_init(struct transport *transport, const char *name);
227 int bidirectional_transfer_loop(int input, int output);
228
229 /* common methods used by transport.c and builtin/send-pack.c */
230 -void transport_verify_remote_names(int nr_heads, const char **heads);
231 -
230 void transport_update_tracking_ref(struct remote *remote, struct ref *ref, int verbose);
231
232 int transport_refs_pushed(struct ref *ref);