summaryrefslogtreecommitdiff
path: root/builtin/checkout-index.c
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-08-13 18:14:32 +0200
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-08-13 14:14:43 -0700
commit74cfc0ee1d0b4e386b5a07f8b79fbcece94cdff8 (patch)
treed72727b10a63cbd35dd17bec03e3517d6cd9465c /builtin/checkout-index.c
parentsubmodule.c: use the right index instead of the_index (diff)
downloadtgif-74cfc0ee1d0b4e386b5a07f8b79fbcece94cdff8.tar.xz
entry.c: use the right index instead of the_index
checkout-index.c needs update because if checkout->istate is NULL, ie_match_stat() will crash. Previously this is ie_match_stat(&the_index, ..) so it will not crash, but it is not technically correct either. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/checkout-index.c')
-rw-r--r--builtin/checkout-index.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/builtin/checkout-index.c b/builtin/checkout-index.c
index a730f6a1aa..d92db62fbd 100644
--- a/builtin/checkout-index.c
+++ b/builtin/checkout-index.c
@@ -190,6 +190,7 @@ int cmd_checkout_index(int argc, const char **argv, const char *prefix)
argc = parse_options(argc, argv, prefix, builtin_checkout_index_options,
builtin_checkout_index_usage, 0);
+ state.istate = &the_index;
state.force = force;
state.quiet = quiet;
state.not_new = not_new;