builtin/fetch: remove unique promisor remote limitation
authorChristian Couder <christian.couder@gmail.com>
Tue, 25 Jun 2019 13:40:33 +0000 (15:40 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 25 Jun 2019 21:05:37 +0000 (14:05 -0700)
As the infrastructure for more than one promisor remote
has been introduced in previous patches, we can remove
code that forbids the registration of more than one
promisor remote.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch.c
index 13d813313089c764c124d246c738a06c6fed57a4..5657d054ec55f71cbf8f117e93516f6193cb4bf3 100644 (file)
@@ -1465,26 +1465,16 @@ static inline void fetch_one_setup_partial(struct remote *remote)
                return;
 
        /*
-        * If this is the FIRST partial-fetch request, we enable partial
-        * on this repo and remember the given filter-spec as the default
-        * for subsequent fetches to this remote.
+        * If this is a partial-fetch request, we enable partial on
+        * this repo if not already enabled and remember the given
+        * filter-spec as the default for subsequent fetches to this
+        * remote.
         */
-       if (!has_promisor_remote() && filter_options.choice) {
+       if (filter_options.choice) {
                partial_clone_register(remote->name, &filter_options);
                return;
        }
 
-       /*
-        * We are currently limited to only ONE promisor remote and only
-        * allow partial-fetches from the promisor remote.
-        */
-       if (!promisor_remote_find(remote->name)) {
-               if (filter_options.choice)
-                       die(_("--filter can only be used with the remote "
-                             "configured in extensions.partialClone"));
-               return;
-       }
-
        /*
         * Do a partial-fetch from the promisor remote using either the
         * explicitly given filter-spec or inherit the filter-spec from