From: Junio C Hamano Date: Tue, 8 May 2018 06:59:29 +0000 (+0900) Subject: Merge branch 'hn/sort-ls-remote' X-Git-Tag: v2.18.0-rc0~85 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/6c0110ff0648ad1f8eb97edb7f43039c8c47f29f Merge branch 'hn/sort-ls-remote' "git ls-remote" learned an option to allow sorting its output based on the refnames being shown. * hn/sort-ls-remote: ls-remote: create '--sort' option --- 6c0110ff0648ad1f8eb97edb7f43039c8c47f29f diff --cc builtin/ls-remote.c index 380c180270,d3851074c2..ca3f04a839 --- a/builtin/ls-remote.c +++ b/builtin/ls-remote.c @@@ -1,8 -1,8 +1,9 @@@ #include "builtin.h" #include "cache.h" #include "transport.h" + #include "ref-filter.h" #include "remote.h" +#include "refs.h" static const char * const ls_remote_usage[] = { N_("git ls-remote [--heads] [--tags] [--refs] [--upload-pack=]\n" @@@ -44,7 -44,7 +45,8 @@@ int cmd_ls_remote(int argc, const char int show_symref_target = 0; const char *uploadpack = NULL; const char **pattern = NULL; + struct argv_array ref_prefixes = ARGV_ARRAY_INIT; + int i; struct remote *remote; struct transport *transport; @@@ -108,9 -106,11 +117,11 @@@ if (uploadpack != NULL) transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack); - ref = transport_get_remote_refs(transport); + ref = transport_get_remote_refs(transport, &ref_prefixes); - if (transport_disconnect(transport)) + if (transport_disconnect(transport)) { + UNLEAK(sorting); return 1; + } if (!dest && !quiet) fprintf(stderr, "From %s\n", *remote->url);