builtin/clone: stop using `the_index`

Convert git-clone(1) to use `the_repository->index` instead of `the_index`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Patrick Steinhardt committed Apr 18, 2024 at 14:14 UTC 9ee6d63babb8beaace8c654df6c65ff61f3697b8
1 file changed +3 -4
builtin/clone.c
+3 -4
@@ -8,7 +8,6 @@
8 * Clone a repository into a different directory that does not yet exist.
9 */
10
11 -#define USE_THE_INDEX_VARIABLE
11 #include "builtin.h"
12 #include "abspath.h"
13 #include "advice.h"
@@ -731,8 +730,8 @@ static int checkout(int submodule_progress, int filter_submodules)
730 opts.preserve_ignored = 0;
731 opts.fn = oneway_merge;
732 opts.verbose_update = (option_verbosity >= 0);
734 - opts.src_index = &the_index;
735 - opts.dst_index = &the_index;
733 + opts.src_index = the_repository->index;
734 + opts.dst_index = the_repository->index;
735 init_checkout_metadata(&opts.meta, head, &oid, NULL);
736
737 tree = parse_tree_indirect(&oid);
@@ -746,7 +745,7 @@ static int checkout(int submodule_progress, int filter_submodules)
745
746 free(head);
747
749 - if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
748 + if (write_locked_index(the_repository->index, &lock_file, COMMIT_LOCK))
749 die(_("unable to write new index file"));
750
751 err |= run_hooks_l("post-checkout", oid_to_hex(null_oid()),