remote.c: hoist read_config into remote_get_1

Before the previous commit, we had to make sure that read_config() was called before entering remote_get_1, because we needed to pass pushremote_name by value. But now that we pass a function, we can let remote_get_1 handle loading the config itself, turning our wrappers into true one-liners. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed May 21, 2015 at 00:45 UTC 8770e6fbb28dffdf9e00d05365120e438d3d236f
1 file changed +2 -2
remote.c
+2 -2
@@ -718,6 +718,8 @@ static struct remote *remote_get_1(const char *name,
718 struct remote *ret;
719 int name_given = 0;
720
721 + read_config();
722 +
723 if (name)
724 name_given = 1;
725 else
@@ -741,13 +743,11 @@ static struct remote *remote_get_1(const char *name,
743
744 struct remote *remote_get(const char *name)
745 {
744 - read_config();
746 return remote_get_1(name, remote_for_branch);
747 }
748
749 struct remote *pushremote_get(const char *name)
750 {
750 - read_config();
751 return remote_get_1(name, pushremote_for_branch);
752 }
753