]> git.ipfire.org Git - thirdparty/git.git/blobdiff - list-objects-filter-options.c
strmap: enable allocations to come from a mem_pool
[thirdparty/git.git] / list-objects-filter-options.c
index b66314560ac957d722985ad935ecb7fb49663b85..defd3dfd101f414c5708dc576ff4b7fac8a058a3 100644 (file)
@@ -344,11 +344,19 @@ void partial_clone_register(
        const char *remote,
        struct list_objects_filter_options *filter_options)
 {
+       struct promisor_remote *promisor_remote;
        char *cfg_name;
        char *filter_name;
 
        /* Check if it is already registered */
-       if (!promisor_remote_find(remote)) {
+       if ((promisor_remote = promisor_remote_find(remote))) {
+               if (promisor_remote->partial_clone_filter)
+                       /*
+                        * Remote is already registered and a filter is already
+                        * set, so we don't need to do anything here.
+                        */
+                       return;
+       } else {
                if (upgrade_repository_format(1) < 0)
                        die(_("unable to upgrade repository format to support partial clone"));