remote: use new OPT_STRING_LIST
This saves us having our own callback function. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Jun 9, 2011 at 11:55 UTC
615ff912c5b30f70d5b0d1f6d6764327a3ecd337
1 file changed
+2
-12
builtin/remote.c
+2
-12
@@ -88,16 +88,6 @@ static inline int postfixcmp(const char *string, const char *postfix)
88
return strcmp(string + len1 - len2, postfix);
89
}
90
91
-static int opt_parse_track(const struct option *opt, const char *arg, int not)
92
-{
93
- struct string_list *list = opt->value;
94
- if (not)
95
- string_list_clear(list, 0);
96
- else
97
- string_list_append(list, arg);
98
- return 0;
99
-}
100
-
91
static int fetch_remote(const char *name)
92
{
93
const char *argv[] = { "fetch", name, NULL, NULL };
@@ -176,8 +166,8 @@ static int add(int argc, const char **argv)
166
TAGS_SET),
167
OPT_SET_INT(0, NULL, &fetch_tags,
168
"or do not fetch any tag at all (--no-tags)", TAGS_UNSET),
179
- OPT_CALLBACK('t', "track", &track, "branch",
180
- "branch(es) to track", opt_parse_track),
169
+ OPT_STRING_LIST('t', "track", &track, "branch",
170
+ "branch(es) to track"),
171
OPT_STRING('m', "master", &master, "branch", "master branch"),
172
{ OPTION_CALLBACK, 0, "mirror", &mirror, "push|fetch",
173
"set up remote as a mirror to push to or fetch from",