From patchwork Thu May 9 21:31:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff King X-Patchwork-Id: 10937889 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 041EC76 for ; Thu, 9 May 2019 21:31:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E6EFF28BE6 for ; Thu, 9 May 2019 21:31:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DB22E28BE8; Thu, 9 May 2019 21:31:49 +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=-7.9 required=2.0 tests=BAYES_00,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 7C09528BE6 for ; Thu, 9 May 2019 21:31:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727028AbfEIVbs (ORCPT ); Thu, 9 May 2019 17:31:48 -0400 Received: from cloud.peff.net ([104.130.231.41]:53714 "HELO cloud.peff.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1726219AbfEIVbs (ORCPT ); Thu, 9 May 2019 17:31:48 -0400 Received: (qmail 10104 invoked by uid 109); 9 May 2019 21:31:48 -0000 Received: from Unknown (HELO peff.net) (10.0.1.2) by cloud.peff.net (qpsmtpd/0.94) with SMTP; Thu, 09 May 2019 21:31:48 +0000 Authentication-Results: cloud.peff.net; auth=none Received: (qmail 6577 invoked by uid 111); 9 May 2019 21:32:25 -0000 Received: from sigill.intra.peff.net (HELO sigill.intra.peff.net) (10.0.0.7) by peff.net (qpsmtpd/0.94) with (ECDHE-RSA-AES256-GCM-SHA384 encrypted) SMTP; Thu, 09 May 2019 17:32:25 -0400 Authentication-Results: peff.net; auth=none Received: by sigill.intra.peff.net (sSMTP sendmail emulation); Thu, 09 May 2019 17:31:46 -0400 Date: Thu, 9 May 2019 17:31:46 -0400 From: Jeff King To: git@vger.kernel.org Subject: [PATCH 11/14] remove_all_fetch_refspecs(): drop unused "remote" parameter Message-ID: <20190509213146.GK15837@sigill.intra.peff.net> References: <20190509212558.GA15438@sigill.intra.peff.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20190509212558.GA15438@sigill.intra.peff.net> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This function already takes a "key" parameter which uniquely identifies the config key that we need to remove. There's no need for it to look at the "remote" parameter at all. Let's drop it in the name of simplicity. Signed-off-by: Jeff King --- builtin/remote.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/remote.c b/builtin/remote.c index f7edf7f2cb..5591cef775 100644 --- a/builtin/remote.c +++ b/builtin/remote.c @@ -1407,7 +1407,7 @@ static int update(int argc, const char **argv) return retval; } -static int remove_all_fetch_refspecs(const char *remote, const char *key) +static int remove_all_fetch_refspecs(const char *key) { return git_config_set_multivar_gently(key, NULL, NULL, 1); } @@ -1437,7 +1437,7 @@ static int set_remote_branches(const char *remotename, const char **branches, if (!remote_is_configured(remote, 1)) die(_("No such remote '%s'"), remotename); - if (!add_mode && remove_all_fetch_refspecs(remotename, key.buf)) { + if (!add_mode && remove_all_fetch_refspecs(key.buf)) { strbuf_release(&key); return 1; }