Skip to content

Commit

Permalink
checkout-index: simplify "-z" option parsing
Browse files Browse the repository at this point in the history
Now that we act as a simple bool, there's no need to use a
custom callback.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Feb 1, 2016
1 parent 0d4cc1b commit 9096ee1
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions builtin/checkout-index.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,13 +142,6 @@ static int option_parse_u(const struct option *opt,
return 0;
}

static int option_parse_z(const struct option *opt,
const char *arg, int unset)
{
nul_term_line = !unset;
return 0;
}

static int option_parse_prefix(const struct option *opt,
const char *arg, int unset)
{
Expand Down Expand Up @@ -192,9 +185,8 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
{ OPTION_CALLBACK, 'u', "index", &newfd, NULL,
N_("update stat information in the index file"),
PARSE_OPT_NOARG, option_parse_u },
{ OPTION_CALLBACK, 'z', NULL, NULL, NULL,
N_("paths are separated with NUL character"),
PARSE_OPT_NOARG, option_parse_z },
OPT_BOOL('z', NULL, &nul_term_line,
N_("paths are separated with NUL character")),
OPT_BOOL(0, "stdin", &read_from_stdin,
N_("read list of paths from the standard input")),
OPT_BOOL(0, "temp", &to_tempfile,
Expand Down

0 comments on commit 9096ee1

Please sign in to comment.