summaryrefslogtreecommitdiff
path: root/templates
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2016-01-31 06:29:36 -0500
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-02-01 13:43:43 -0800
commit6a6df8aa45aa68df737d6c59d7abec499e9451da (patch)
treec77a49cf347bad89c00f7cc8869e3173ef259c96 /templates
parentcheckout-index: handle "--no-prefix" option (diff)
downloadtgif-6a6df8aa45aa68df737d6c59d7abec499e9451da.tar.xz
checkout-index: handle "--no-index" option
The parsing of "--index" is done in a callback, but it does not handle an "unset" option. We don't necessarily expect anyone to use this, but the current behavior is to treat it exactly like "--index", which would probably be surprising. Instead, let's just turn it into an OPT_BOOL, and handle it after we're done parsing. This makes "--no-index" just work (it cancels a previous "--index"). As a bonus, this makes the logic easier to follow. The old code opened the index during the option parsing, leaving the reader to wonder if there was some timing issue (there isn't; none of the other options care that we've opened it). And then if we found that "--prefix" had been given, we had to rollback the index. Now we can simply avoid opening it in the first place. Note that it might make more sense for checkout-index to complain when "--index --prefix=foo" is given (rather than silently ignoring "--index"), but since it has been that way since 415e96c ([PATCH] Implement git-checkout-cache -u to update stat information in the cache., 2005-05-15), it's safer to leave it as-is. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'templates')
0 files changed, 0 insertions, 0 deletions