]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/ls-remote.c
shortlog: change "author" variables to "ident"
[thirdparty/git.git] / builtin / ls-remote.c
index 1d7f1f5ce27834cafcf934db2085b36d4301e3c0..3a4dd12903206ae47fd4683e3bef1a7371d67d55 100644 (file)
@@ -67,8 +67,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
                OPT_BIT(0, "refs", &flags, N_("do not show peeled tags"), REF_NORMAL),
                OPT_BOOL(0, "get-url", &get_url,
                         N_("take url.<base>.insteadOf into account")),
-               OPT_CALLBACK(0 , "sort", sorting_tail, N_("key"),
-                            N_("field name to sort on"), &parse_opt_ref_sorting),
+               OPT_REF_SORT(sorting_tail),
                OPT_SET_INT_F(0, "exit-code", &status,
                              N_("exit with exit code 2 if no matching refs are found"),
                              2, PARSE_OPT_NOCOMPLETE),
@@ -119,6 +118,10 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
                transport->server_options = &server_options;
 
        ref = transport_get_remote_refs(transport, &ref_prefixes);
+       if (ref) {
+               int hash_algo = hash_algo_by_ptr(transport_get_hash_algo(transport));
+               repo_set_hash_algo(the_repository, hash_algo);
+       }
        if (transport_disconnect(transport)) {
                UNLEAK(sorting);
                return 1;