summaryrefslogtreecommitdiff
path: root/builtin/checkout-index.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-01-31 11:25:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-01 21:43:16 (GMT)
commit9096ee162b7e4e426b1719bb43f9e42e84c95816 (patch)
treecadcc7cdb04f6b1e56a8c3527703d82fb465fc8e /builtin/checkout-index.c
parent0d4cc1b45bf063b3a46654098a9fb85f82f386a7 (diff)
downloadgit-9096ee162b7e4e426b1719bb43f9e42e84c95816.zip
git-9096ee162b7e4e426b1719bb43f9e42e84c95816.tar.gz
git-9096ee162b7e4e426b1719bb43f9e42e84c95816.tar.bz2
checkout-index: simplify "-z" option parsing
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>
Diffstat (limited to 'builtin/checkout-index.c')
-rw-r--r--builtin/checkout-index.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c
index d8d7bd3..3b913d1 100644
--- a/builtin/checkout-index.c
+++ b/builtin/checkout-index.c
@@ -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)
{
@@ -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,