From patchwork Tue Mar 12 13:29:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Couder X-Patchwork-Id: 10849223 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 841E36C2 for ; Tue, 12 Mar 2019 13:30:25 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71C5529574 for ; Tue, 12 Mar 2019 13:30:25 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6F84529656; Tue, 12 Mar 2019 13:30:25 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E48E2962F for ; Tue, 12 Mar 2019 13:30:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726703AbfCLNaY (ORCPT ); Tue, 12 Mar 2019 09:30:24 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:32868 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725774AbfCLNaV (ORCPT ); Tue, 12 Mar 2019 09:30:21 -0400 Received: by mail-ed1-f67.google.com with SMTP id d12so2320288edp.0 for ; Tue, 12 Mar 2019 06:30:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=U4N+VL7xrP7XWFLQZvSKADPDiuJ6H3btFTJWpW9kTe0=; b=Qyo0LrukHUR4W4+u56Fsrw36KMed4T1w8ksJQhhzPTaeata7sZ9ORzbnCIIO8Fm9Db 0eE1NVq0DM/LFHgJ6tVNpeFjRy/hFV346s3+OKdwKX/kkhhh9ZBn9WYLuiq6IaSl+BvH 7ZtjXVw4GyQcwUhetE/CAeWg2xP3/Zpnt0FtESKBH1hRBvOA5IgRPV6jlcxAMiDSl5V5 WQ2E70pdN778cGJXNQ+XZ2z15AOHu+IDYTyVg/RTLX3JetoeFP6n9hA5cdj/FnRyibcn XA5jOjVlQPVQlqHMEJ46qAjkzBjPvmlE09rWvVh1m4jTTDRMHaRoASOdZGwdT1N6yDTl Nbrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=U4N+VL7xrP7XWFLQZvSKADPDiuJ6H3btFTJWpW9kTe0=; b=N/z8jVitYtEBsWEQ86PRcE0WimYOc1cOXRbphSe33x7mYtkz5yRUCeoLzOGwd8Z20O y57pSuRxiGhG6RtgW5LhogFS4+aXq4Hsfk9LeBIHy1GyfqltlW3K0pvYPdy+9SK39hyG /JStRmEzmZcJluHF1K/a/56XLG+Hu+xleu2y27EDkWB7E+HuZKtt4yYMggWqIOwirDNZ KpbKP1xWN71NKxhyRR4hlSha/M31IxbF2qjrlluvAvC7UZsDAbqEYB/3y28AQ/cVJfZZ my0pMAjGIukHhiCI5UZJJdoxd7TCdGf/HL9WRgyybj2r1KYvngJFavnkfl/ecpGo0Gsj +f/w== X-Gm-Message-State: APjAAAU3exqyvyj2DP52jH/1yoGq9gbUXsQCmg/tj4uEQY7jN6vjrfZ3 dFQBzHWTlmgrQjdd+PJGGluqf15y X-Google-Smtp-Source: APXvYqxXHtpGqpksXK20XIeWMUy2IzsHAVNaGpm5C6My20boHHSNO1XbuvuW3WE5gOX7Z57uEVK6sQ== X-Received: by 2002:a17:906:3c3:: with SMTP id c3mr25006240eja.181.1552397419758; Tue, 12 Mar 2019 06:30:19 -0700 (PDT) Received: from ubuntu-N750HU.booking.pcln.com (access-114.38.rev.fr.colt.net. [213.41.38.114]) by smtp.gmail.com with ESMTPSA id h8sm5875213edk.21.2019.03.12.06.30.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 12 Mar 2019 06:30:18 -0700 (PDT) From: Christian Couder X-Google-Original-From: Christian Couder To: git@vger.kernel.org Cc: Junio C Hamano , Jeff King , Ben Peart , Jonathan Tan , Jonathan Nieder , Stefan Beller , Nguyen Thai Ngoc Duy , Mike Hommey , Lars Schneider , Eric Wong , Christian Couder , Jeff Hostetler , Eric Sunshine , Beat Bolli Subject: [PATCH v3 05/11] promisor-remote: use repository_format_partial_clone Date: Tue, 12 Mar 2019 14:29:53 +0100 Message-Id: <20190312132959.11764-6-chriscool@tuxfamily.org> X-Mailer: git-send-email 2.21.0.166.gb5e4dbcfd3 In-Reply-To: <20190312132959.11764-1-chriscool@tuxfamily.org> References: <20190312132959.11764-1-chriscool@tuxfamily.org> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A remote specified using the extensions.partialClone config option should be considered a promisor remote too. This remote should be at the end of the promisor remote list, so that it is used only if objects have not been found in other remotes. Signed-off-by: Christian Couder --- promisor-remote.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/promisor-remote.c b/promisor-remote.c index ea74f6d8a8..dcf6ef6521 100644 --- a/promisor-remote.c +++ b/promisor-remote.c @@ -83,6 +83,17 @@ static void promisor_remote_do_init(int force) initialized = 1; git_config(promisor_remote_config, NULL); + + if (repository_format_partial_clone) { + struct promisor_remote *o, *previous; + + o = promisor_remote_look_up(repository_format_partial_clone, + &previous); + if (o) + promisor_remote_move_to_tail(o, previous); + else + promisor_remote_new(repository_format_partial_clone); + } } static inline void promisor_remote_init(void)