]> git.ipfire.org Git - thirdparty/git.git/blobdiff - send-pack.c
fmt-merge-msg: free newly allocated temporary strings when done
[thirdparty/git.git] / send-pack.c
index 9cb9f716509b00ec394bb901b61d679eaa04045d..5a79e0e711031907bcec04acc18a64c2b9d40adc 100644 (file)
@@ -486,6 +486,12 @@ int send_pack(struct send_pack_args *args,
        const char *push_cert_nonce = NULL;
        struct packet_reader reader;
 
+       if (!remote_refs) {
+               fprintf(stderr, "No refs in common and none specified; doing nothing.\n"
+                       "Perhaps you should specify a branch.\n");
+               return 0;
+       }
+
        git_config_get_bool("push.negotiate", &push_negotiate);
        if (push_negotiate)
                get_commons_through_negotiation(args->url, remote_refs, &commons);
@@ -534,11 +540,6 @@ int send_pack(struct send_pack_args *args,
                }
        }
 
-       if (!remote_refs) {
-               fprintf(stderr, "No refs in common and none specified; doing nothing.\n"
-                       "Perhaps you should specify a branch.\n");
-               return 0;
-       }
        if (args->atomic && !atomic_supported)
                die(_("the receiving end does not support --atomic push"));