Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
checkout-index: simplify "-z" option parsing
author
Jeff King
<peff@peff.net>
Sun, 31 Jan 2016 11:25:43 +0000
(06:25 -0500)
committer
Junio C Hamano
<gitster@pobox.com>
Mon, 1 Feb 2016 21:43:16 +0000
(13:43 -0800)
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>
builtin/checkout-index.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
0d4cc1b
)
diff --git
a/builtin/checkout-index.c
b/builtin/checkout-index.c
index d8d7bd385408a344a6ed4d07132864577b4c7d99..3b913d1b3710f012117f5520755fdbc89c54c82f 100644
(file)
--- 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;
}
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)
{
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, '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,
OPT_BOOL(0, "stdin", &read_from_stdin,
N_("read list of paths from the standard input")),
OPT_BOOL(0, "temp", &to_tempfile,