Skip to content

Commit 615ff91

Browse files
peffgitster
authored andcommitted
remote: use new OPT_STRING_LIST
This saves us having our own callback function. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c8ba163 commit 615ff91

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

builtin/remote.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,6 @@ static inline int postfixcmp(const char *string, const char *postfix)
8888
return strcmp(string + len1 - len2, postfix);
8989
}
9090

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-
10191
static int fetch_remote(const char *name)
10292
{
10393
const char *argv[] = { "fetch", name, NULL, NULL };
@@ -176,8 +166,8 @@ static int add(int argc, const char **argv)
176166
TAGS_SET),
177167
OPT_SET_INT(0, NULL, &fetch_tags,
178168
"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"),
181171
OPT_STRING('m', "master", &master, "branch", "master branch"),
182172
{ OPTION_CALLBACK, 0, "mirror", &mirror, "push|fetch",
183173
"set up remote as a mirror to push to or fetch from",

0 commit comments

Comments
 (0)