Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Tan <jonathantanmy@google.com>2021-02-05 23:48:48 +0300
committerJunio C Hamano <gitster@pobox.com>2021-02-06 00:49:54 +0300
commit39835409d10de2402c4b3e10dba20286989627d4 (patch)
treeb7517eb09a0c3a2298408ca81ef30d08e7ebf532 /builtin/ls-remote.c
parent59e1205d167c9acc17114a2f96425325470b1db8 (diff)
connect, transport: encapsulate arg in struct
In a future patch we plan to return the name of an unborn current branch from deep in the callchain to a caller via a new pointer parameter that points at a variable in the caller when the caller calls get_remote_refs() and transport_get_remote_refs(). In preparation for that, encapsulate the existing ref_prefixes parameter into a struct. The aforementioned unborn current branch will go into this new struct in the future patch. Signed-off-by: Jonathan Tan <jonathantanmy@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/ls-remote.c')
-rw-r--r--builtin/ls-remote.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index 092917eca2..ef604752a0 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -45,7 +45,8 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
int show_symref_target = 0;
const char *uploadpack = NULL;
const char **pattern = NULL;
- struct strvec ref_prefixes = STRVEC_INIT;
+ struct transport_ls_refs_options transport_options =
+ TRANSPORT_LS_REFS_OPTIONS_INIT;
int i;
struct string_list server_options = STRING_LIST_INIT_DUP;
@@ -94,9 +95,9 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
}
if (flags & REF_TAGS)
- strvec_push(&ref_prefixes, "refs/tags/");
+ strvec_push(&transport_options.ref_prefixes, "refs/tags/");
if (flags & REF_HEADS)
- strvec_push(&ref_prefixes, "refs/heads/");
+ strvec_push(&transport_options.ref_prefixes, "refs/heads/");
remote = remote_get(dest);
if (!remote) {
@@ -118,7 +119,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
if (server_options.nr)
transport->server_options = &server_options;
- ref = transport_get_remote_refs(transport, &ref_prefixes);
+ ref = transport_get_remote_refs(transport, &transport_options);
if (ref) {
int hash_algo = hash_algo_by_ptr(transport_get_hash_algo(transport));
repo_set_hash_algo(the_repository, hash_algo);