diff options
author | Jeff King <peff@peff.net> | 2015-05-21 00:45:23 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-05-21 11:04:10 -0700 |
commit | 8770e6fbb28dffdf9e00d05365120e438d3d236f (patch) | |
tree | 52ccef47c493627d37ecca02815ff567c9863a2c /remote.c | |
parent | da66b2743cf7244e52c4b9d91646b782cd4f7eeb (diff) | |
download | git-8770e6fbb28dffdf9e00d05365120e438d3d236f.tar.gz |
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>
Diffstat (limited to 'remote.c')
-rw-r--r-- | remote.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -718,6 +718,8 @@ static struct remote *remote_get_1(const char *name, struct remote *ret; int name_given = 0; + read_config(); + if (name) name_given = 1; else @@ -741,13 +743,11 @@ static struct remote *remote_get_1(const char *name, struct remote *remote_get(const char *name) { - read_config(); return remote_get_1(name, remote_for_branch); } struct remote *pushremote_get(const char *name) { - read_config(); return remote_get_1(name, pushremote_for_branch); } |