Merge branch 'nd/no-the-index'
The more library-ish parts of the codebase learned to work on the in-core index-state instance that is passed in by their callers, instead of always working on the singleton "the_index" instance. * nd/no-the-index: (24 commits) blame.c: remove implicit dependency on the_index apply.c: remove implicit dependency on the_index apply.c: make init_apply_state() take a struct repository apply.c: pass struct apply_state to more functions resolve-undo.c: use the right index instead of the_index archive-*.c: use the right repository archive.c: avoid access to the_index grep: use the right index instead of the_index attr: remove index from git_attr_set_direction() entry.c: use the right index instead of the_index submodule.c: use the right index instead of the_index pathspec.c: use the right index instead of the_index unpack-trees: avoid the_index in verify_absent() unpack-trees: convert clear_ce_flags* to avoid the_index unpack-trees: don't shadow global var the_index unpack-trees: add a note about path invalidation unpack-trees: remove 'extern' on function declaration ls-files: correct index argument to get_convert_attr_ascii() preload-index.c: use the right index instead of the_index dir.c: remove an implicit dependency on the_index in pathspec code ...
This commit is contained in:
@ -1253,7 +1253,7 @@ static int try_to_commit(struct strbuf *msg, const char *author,
|
||||
commit_list_insert(current_head, &parents);
|
||||
}
|
||||
|
||||
if (write_cache_as_tree(&tree, 0, NULL)) {
|
||||
if (write_index_as_tree(&tree, &the_index, get_index_file(), 0, NULL)) {
|
||||
res = error(_("git write-tree failed to write a tree"));
|
||||
goto out;
|
||||
}
|
||||
@ -1639,7 +1639,7 @@ static int do_pick_commit(enum todo_command command, struct commit *commit,
|
||||
* that represents the "current" state for merge-recursive
|
||||
* to work on.
|
||||
*/
|
||||
if (write_cache_as_tree(&head, 0, NULL))
|
||||
if (write_index_as_tree(&head, &the_index, get_index_file(), 0, NULL))
|
||||
return error(_("your index file is unmerged."));
|
||||
} else {
|
||||
unborn = get_oid("HEAD", &head);
|
||||
|
Reference in New Issue
Block a user