diff mbox series

[11/14] remove_all_fetch_refspecs(): drop unused "remote" parameter

Message ID 20190509213146.GK15837@sigill.intra.peff.net (mailing list archive)
State New, archived
Headers show
Series [01/14] cmd_{read,write}_tree: rename "unused" variable that is used | expand

Commit Message

Jeff King May 9, 2019, 9:31 p.m. UTC
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 <peff@peff.net>
---
 builtin/remote.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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;
 	}