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>

Jeff King committed Jan 31, 2016 at 06:25 UTC 9096ee162b7e4e426b1719bb43f9e42e84c95816
1 file changed +2 -10
builtin/checkout-index.c
+2 -10
@@ -142,13 +142,6 @@ static int option_parse_u(const struct option *opt,
142 return 0;
143 }
144
145 -static int option_parse_z(const struct option *opt,
146 - const char *arg, int unset)
147 -{
148 - nul_term_line = !unset;
149 - return 0;
150 -}
151 -
145 static int option_parse_prefix(const struct option *opt,
146 const char *arg, int unset)
147 {
@@ -192,9 +185,8 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
185 { OPTION_CALLBACK, 'u', "index", &newfd, NULL,
186 N_("update stat information in the index file"),
187 PARSE_OPT_NOARG, option_parse_u },
195 - { OPTION_CALLBACK, 'z', NULL, NULL, NULL,
196 - N_("paths are separated with NUL character"),
197 - PARSE_OPT_NOARG, option_parse_z },
188 + OPT_BOOL('z', NULL, &nul_term_line,
189 + N_("paths are separated with NUL character")),
190 OPT_BOOL(0, "stdin", &read_from_stdin,
191 N_("read list of paths from the standard input")),
192 OPT_BOOL(0, "temp", &to_tempfile,