]> git.ipfire.org Git - thirdparty/git.git/blobdiff - builtin/ls-remote.c
Merge branch 'ea/blame-use-oideq'
[thirdparty/git.git] / builtin / ls-remote.c
index ea91679f330a96469f04ea7184d27b3494cf64b9..092917eca29b76f27bce31cbf6a5fff562fae7f0 100644 (file)
@@ -83,6 +83,8 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
                             PARSE_OPT_STOP_AT_NON_OPTION);
        dest = argv[0];
 
+       UNLEAK(sorting);
+
        if (argc > 1) {
                int i;
                pattern = xcalloc(argc, sizeof(const char *));
@@ -107,7 +109,6 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
 
        if (get_url) {
                printf("%s\n", *remote->url);
-               UNLEAK(sorting);
                return 0;
        }
 
@@ -122,10 +123,8 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
                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);
+       if (transport_disconnect(transport))
                return 1;
-       }
 
        if (!dest && !quiet)
                fprintf(stderr, "From %s\n", *remote->url);
@@ -150,7 +149,6 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
                status = 0; /* we found something */
        }
 
-       UNLEAK(sorting);
        ref_array_clear(&ref_array);
        return status;
 }