Skip to content

Commit 7a78a82

Browse files
bmwillgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 168dba6 commit 7a78a82

File tree

3 files changed

+0
-28
lines changed

3 files changed

+0
-28
lines changed

builtin/send-pack.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -265,8 +265,6 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
265265
BUG("unknown protocol version");
266266
}
267267

268-
transport_verify_remote_names(rs.raw_nr, rs.raw);
269-
270268
local_refs = get_local_heads();
271269

272270
flags = MATCH_REFS_NONE;

transport.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -619,29 +619,6 @@ void transport_print_push_status(const char *dest, struct ref *refs,
619619
free(head);
620620
}
621621

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-
645622
static int git_transport_push(struct transport *transport, struct ref *remote_refs, int flags)
646623
{
647624
struct git_transport_data *data = transport->data;
@@ -1097,7 +1074,6 @@ int transport_push(struct transport *transport,
10971074
unsigned int *reject_reasons)
10981075
{
10991076
*reject_reasons = 0;
1100-
transport_verify_remote_names(rs->raw_nr, rs->raw);
11011077

11021078
if (transport_color_config() < 0)
11031079
return -1;

transport.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,8 +227,6 @@ int transport_helper_init(struct transport *transport, const char *name);
227227
int bidirectional_transfer_loop(int input, int output);
228228

229229
/* common methods used by transport.c and builtin/send-pack.c */
230-
void transport_verify_remote_names(int nr_heads, const char **heads);
231-
232230
void transport_update_tracking_ref(struct remote *remote, struct ref *ref, int verbose);
233231

234232
int transport_refs_pushed(struct ref *ref);

0 commit comments

Comments
 (0)