summaryrefslogtreecommitdiff
path: root/builtin/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-07-19 09:45:24 -0700
committerJunio C Hamano <gitster@pobox.com>2011-07-19 09:45:24 -0700
commitff94409da9bdc5cafc02ee154bf09060eef3158f (patch)
treed09ac6febc909a19f0cb04c75db7305f93c9cca7 /builtin/remote.c
parentfe01ef31b79af85ca50738b11b048e3fad856d34 (diff)
parent84054f79de35015fc92f73ec4780102dd820e452 (diff)
downloadgit-ff94409da9bdc5cafc02ee154bf09060eef3158f.tar.gz
Merge branch 'jk/clone-cmdline-config'
* jk/clone-cmdline-config: clone: accept config options on the command line config: make git_config_parse_parameter a public function remote: use new OPT_STRING_LIST parse-options: add OPT_STRING_LIST helper
Diffstat (limited to 'builtin/remote.c')
-rw-r--r--builtin/remote.c14
1 files changed, 2 insertions, 12 deletions
diff --git a/builtin/remote.c b/builtin/remote.c
index 9ff1cac69b..05b1f5b76d 100644
--- a/builtin/remote.c
+++ b/builtin/remote.c
@@ -88,16 +88,6 @@ static inline int postfixcmp(const char *string, const char *postfix)
return strcmp(string + len1 - len2, postfix);
}
-static int opt_parse_track(const struct option *opt, const char *arg, int not)
-{
- struct string_list *list = opt->value;
- if (not)
- string_list_clear(list, 0);
- else
- string_list_append(list, arg);
- return 0;
-}
-
static int fetch_remote(const char *name)
{
const char *argv[] = { "fetch", name, NULL, NULL };
@@ -176,8 +166,8 @@ static int add(int argc, const char **argv)
TAGS_SET),
OPT_SET_INT(0, NULL, &fetch_tags,
"or do not fetch any tag at all (--no-tags)", TAGS_UNSET),
- OPT_CALLBACK('t', "track", &track, "branch",
- "branch(es) to track", opt_parse_track),
+ OPT_STRING_LIST('t', "track", &track, "branch",
+ "branch(es) to track"),
OPT_STRING('m', "master", &master, "branch", "master branch"),
{ OPTION_CALLBACK, 0, "mirror", &mirror, "push|fetch",
"set up remote as a mirror to push to or fetch from",