Merge branch 'nd/the-index-final'
The assumption to work on the single "in-core index" instance has been reduced from the library-ish part of the codebase. * nd/the-index-final: cache.h: flip NO_THE_INDEX_COMPATIBILITY_MACROS switch read-cache.c: remove the_* from index_has_changes() merge-recursive.c: remove implicit dependency on the_repository merge-recursive.c: remove implicit dependency on the_index sha1-name.c: remove implicit dependency on the_index read-cache.c: replace update_index_if_able with repo_& read-cache.c: kill read_index() checkout: avoid the_index when possible repository.c: replace hold_locked_index() with repo_hold_locked_index() notes-utils.c: remove the_repository references grep: use grep_opt->repo instead of explict repo argument
This commit is contained in:
@ -4,6 +4,7 @@
|
||||
* Copyright (c) 2018 Pratik Karki
|
||||
*/
|
||||
|
||||
#define USE_THE_INDEX_COMPATIBILITY_MACROS
|
||||
#include "builtin.h"
|
||||
#include "run-command.h"
|
||||
#include "exec-cmd.h"
|
||||
@ -419,7 +420,7 @@ static int reset_head(struct object_id *oid, const char *action,
|
||||
if (!detach_head)
|
||||
unpack_tree_opts.reset = 1;
|
||||
|
||||
if (read_index_unmerged(the_repository->index) < 0) {
|
||||
if (repo_read_index_unmerged(the_repository) < 0) {
|
||||
ret = error(_("could not read index"));
|
||||
goto leave_reset_head;
|
||||
}
|
||||
@ -1233,13 +1234,12 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
|
||||
die(_("Cannot read HEAD"));
|
||||
|
||||
fd = hold_locked_index(&lock_file, 0);
|
||||
if (read_index(the_repository->index) < 0)
|
||||
if (repo_read_index(the_repository) < 0)
|
||||
die(_("could not read index"));
|
||||
refresh_index(the_repository->index, REFRESH_QUIET, NULL, NULL,
|
||||
NULL);
|
||||
if (0 <= fd)
|
||||
update_index_if_able(the_repository->index,
|
||||
&lock_file);
|
||||
repo_update_index_if_able(the_repository, &lock_file);
|
||||
rollback_lock_file(&lock_file);
|
||||
|
||||
if (has_unstaged_changes(the_repository, 1)) {
|
||||
@ -1591,7 +1591,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
|
||||
get_fork_point(options.upstream_name, head);
|
||||
}
|
||||
|
||||
if (read_index(the_repository->index) < 0)
|
||||
if (repo_read_index(the_repository) < 0)
|
||||
die(_("could not read index"));
|
||||
|
||||
if (options.autostash) {
|
||||
@ -1601,7 +1601,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
|
||||
fd = hold_locked_index(&lock_file, 0);
|
||||
refresh_cache(REFRESH_QUIET);
|
||||
if (0 <= fd)
|
||||
update_index_if_able(&the_index, &lock_file);
|
||||
repo_update_index_if_able(the_repository, &lock_file);
|
||||
rollback_lock_file(&lock_file);
|
||||
|
||||
if (has_unstaged_changes(the_repository, 1) ||
|
||||
@ -1646,7 +1646,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
|
||||
putchar('\n');
|
||||
|
||||
if (discard_index(the_repository->index) < 0 ||
|
||||
read_index(the_repository->index) < 0)
|
||||
repo_read_index(the_repository) < 0)
|
||||
die(_("could not read index"));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user