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>maint
parent
66bce9d00b
commit
9ee6d63bab
|
@ -8,7 +8,6 @@
|
||||||
* Clone a repository into a different directory that does not yet exist.
|
* Clone a repository into a different directory that does not yet exist.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define USE_THE_INDEX_VARIABLE
|
|
||||||
#include "builtin.h"
|
#include "builtin.h"
|
||||||
#include "abspath.h"
|
#include "abspath.h"
|
||||||
#include "advice.h"
|
#include "advice.h"
|
||||||
|
@ -731,8 +730,8 @@ static int checkout(int submodule_progress, int filter_submodules)
|
||||||
opts.preserve_ignored = 0;
|
opts.preserve_ignored = 0;
|
||||||
opts.fn = oneway_merge;
|
opts.fn = oneway_merge;
|
||||||
opts.verbose_update = (option_verbosity >= 0);
|
opts.verbose_update = (option_verbosity >= 0);
|
||||||
opts.src_index = &the_index;
|
opts.src_index = the_repository->index;
|
||||||
opts.dst_index = &the_index;
|
opts.dst_index = the_repository->index;
|
||||||
init_checkout_metadata(&opts.meta, head, &oid, NULL);
|
init_checkout_metadata(&opts.meta, head, &oid, NULL);
|
||||||
|
|
||||||
tree = parse_tree_indirect(&oid);
|
tree = parse_tree_indirect(&oid);
|
||||||
|
@ -746,7 +745,7 @@ static int checkout(int submodule_progress, int filter_submodules)
|
||||||
|
|
||||||
free(head);
|
free(head);
|
||||||
|
|
||||||
if (write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
|
if (write_locked_index(the_repository->index, &lock_file, COMMIT_LOCK))
|
||||||
die(_("unable to write new index file"));
|
die(_("unable to write new index file"));
|
||||||
|
|
||||||
err |= run_hooks_l("post-checkout", oid_to_hex(null_oid()),
|
err |= run_hooks_l("post-checkout", oid_to_hex(null_oid()),
|
||||||
|
|
Loading…
Reference in New Issue