Skip to content

Commit 9ee6d63

Browse files
pks-tgitster
authored andcommitted
builtin/clone: stop using the_index
Convert git-clone(1) to use `the_repository->index` instead of `the_index`. Signed-off-by: Patrick Steinhardt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 66bce9d commit 9ee6d63

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

builtin/clone.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
* Clone a repository into a different directory that does not yet exist.
99
*/
1010

11-
#define USE_THE_INDEX_VARIABLE
1211
#include "builtin.h"
1312
#include "abspath.h"
1413
#include "advice.h"
@@ -731,8 +730,8 @@ static int checkout(int submodule_progress, int filter_submodules)
731730
opts.preserve_ignored = 0;
732731
opts.fn = oneway_merge;
733732
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;
736735
init_checkout_metadata(&opts.meta, head, &oid, NULL);
737736

738737
tree = parse_tree_indirect(&oid);
@@ -746,7 +745,7 @@ static int checkout(int submodule_progress, int filter_submodules)
746745

747746
free(head);
748747

749-
if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
748+
if (write_locked_index(the_repository->index, &lock_file, COMMIT_LOCK))
750749
die(_("unable to write new index file"));
751750

752751
err |= run_hooks_l("post-checkout", oid_to_hex(null_oid()),

0 commit comments

Comments
 (0)