checkout-index: handle "--no-prefix" option
commit5ed5f671c4193f2b9d47c08e989574903f3bf9cc
authorJeff King <peff@peff.net>
Sun, 31 Jan 2016 11:26:16 +0000 (31 06:26 -0500)
committerJunio C Hamano <gitster@pobox.com>
Mon, 1 Feb 2016 21:43:30 +0000 (1 13:43 -0800)
tree2447fafcbb557c51b191fde384c5ea202327eb92
parent9096ee162b7e4e426b1719bb43f9e42e84c95816
checkout-index: handle "--no-prefix" option

We use a custom callback to parse "--prefix", but it does
not handle the "unset" case. As a result, passing
"--no-prefix" will cause a segfault.

We can fix this by switching it to an OPT_STRING, which
makes "--no-prefix" counteract a previous "--prefix". Note
that this assigns NULL, so we bump our default-case
initialization to lower in the main function.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/checkout-index.c