summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2018-05-16 22:58:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-17 21:19:44 (GMT)
commit7a78a82b6c3bb2a6ebaddf3354b6d97939bdb2ab (patch)
tree90d4a2725ad3d357fa521a82c3634d43805be681
parent168dba68c9ee2f35b40ec306a7b984e90cce2648 (diff)
downloadgit-7a78a82b6c3bb2a6ebaddf3354b6d97939bdb2ab.zip
git-7a78a82b6c3bb2a6ebaddf3354b6d97939bdb2ab.tar.gz
git-7a78a82b6c3bb2a6ebaddf3354b6d97939bdb2ab.tar.bz2
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>
-rw-r--r--builtin/send-pack.c2
-rw-r--r--transport.c24
-rw-r--r--transport.h2
3 files changed, 0 insertions, 28 deletions
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index ef51261..7c34bf4 100644
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
@@ -265,8 +265,6 @@ int cmd_send_pack(int argc, const char **argv, const char *prefix)
BUG("unknown protocol version");
}
- transport_verify_remote_names(rs.raw_nr, rs.raw);
-
local_refs = get_local_heads();
flags = MATCH_REFS_NONE;
diff --git a/transport.c b/transport.c
index a89f177..fe96c0b 100644
--- a/transport.c
+++ b/transport.c
@@ -619,29 +619,6 @@ void transport_print_push_status(const char *dest, struct ref *refs,
free(head);
}
-void transport_verify_remote_names(int nr_heads, const char **heads)
-{
- int i;
-
- for (i = 0; i < nr_heads; i++) {
- const char *local = heads[i];
- const char *remote = strrchr(heads[i], ':');
-
- if (*local == '+')
- local++;
-
- /* A matching refspec is okay. */
- if (remote == local && remote[1] == '\0')
- continue;
-
- remote = remote ? (remote + 1) : local;
- if (check_refname_format(remote,
- REFNAME_ALLOW_ONELEVEL|REFNAME_REFSPEC_PATTERN))
- die("remote part of refspec is not a valid name in %s",
- heads[i]);
- }
-}
-
static int git_transport_push(struct transport *transport, struct ref *remote_refs, int flags)
{
struct git_transport_data *data = transport->data;
@@ -1097,7 +1074,6 @@ int transport_push(struct transport *transport,
unsigned int *reject_reasons)
{
*reject_reasons = 0;
- transport_verify_remote_names(rs->raw_nr, rs->raw);
if (transport_color_config() < 0)
return -1;
diff --git a/transport.h b/transport.h
index e2c809a..bac085c 100644
--- a/transport.h
+++ b/transport.h
@@ -227,8 +227,6 @@ int transport_helper_init(struct transport *transport, const char *name);
int bidirectional_transfer_loop(int input, int output);
/* common methods used by transport.c and builtin/send-pack.c */
-void transport_verify_remote_names(int nr_heads, const char **heads);
-
void transport_update_tracking_ref(struct remote *remote, struct ref *ref, int verbose);
int transport_refs_pushed(struct ref *ref);