Merge branch 'ps/environ-wo-the-repository'
Code clean-up. * ps/environ-wo-the-repository: (21 commits) environment: stop storing "core.notesRef" globally environment: stop storing "core.warnAmbiguousRefs" globally environment: stop storing "core.preferSymlinkRefs" globally environment: stop storing "core.logAllRefUpdates" globally refs: stop modifying global `log_all_ref_updates` variable branch: stop modifying `log_all_ref_updates` variable repo-settings: track defaults close to `struct repo_settings` repo-settings: split out declarations into a standalone header environment: guard state depending on a repository environment: reorder header to split out `the_repository`-free section environment: move `set_git_dir()` and related into setup layer environment: make `get_git_namespace()` self-contained environment: move object database functions into object layer config: make dependency on repo in `read_early_config()` explicit config: document `read_early_config()` and `read_very_early_config()` environment: make `get_git_work_tree()` accept a repository environment: make `get_graft_file()` accept a repository environment: make `get_index_file()` accept a repository environment: make `get_object_directory()` accept a repository environment: make `get_git_common_dir()` accept a repository ...
This commit is contained in:
@ -19,6 +19,7 @@
|
||||
#include "entry.h"
|
||||
#include "preload-index.h"
|
||||
#include "read-cache.h"
|
||||
#include "repository.h"
|
||||
#include "rerere.h"
|
||||
#include "revision.h"
|
||||
#include "setup.h"
|
||||
@ -539,8 +540,8 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,
|
||||
NULL, NULL, NULL))
|
||||
return error(_("could not write index"));
|
||||
|
||||
if (write_index_as_tree(&c_tree, the_repository->index, get_index_file(), 0,
|
||||
NULL))
|
||||
if (write_index_as_tree(&c_tree, the_repository->index,
|
||||
repo_get_index_file(the_repository), 0, NULL))
|
||||
return error(_("cannot apply a stash in the middle of a merge"));
|
||||
|
||||
if (index) {
|
||||
@ -565,7 +566,7 @@ static int do_apply_stash(const char *prefix, struct stash_info *info,
|
||||
discard_index(the_repository->index);
|
||||
repo_read_index(the_repository);
|
||||
if (write_index_as_tree(&index_tree, the_repository->index,
|
||||
get_index_file(), 0, NULL))
|
||||
repo_get_index_file(the_repository), 0, NULL))
|
||||
return error(_("could not save index tree"));
|
||||
|
||||
reset_head();
|
||||
@ -640,9 +641,9 @@ restore_untracked:
|
||||
cp.git_cmd = 1;
|
||||
cp.dir = prefix;
|
||||
strvec_pushf(&cp.env, GIT_WORK_TREE_ENVIRONMENT"=%s",
|
||||
absolute_path(get_git_work_tree()));
|
||||
absolute_path(repo_get_work_tree(the_repository)));
|
||||
strvec_pushf(&cp.env, GIT_DIR_ENVIRONMENT"=%s",
|
||||
absolute_path(get_git_dir()));
|
||||
absolute_path(repo_get_git_dir(the_repository)));
|
||||
strvec_push(&cp.args, "status");
|
||||
run_command(&cp);
|
||||
}
|
||||
@ -1405,8 +1406,8 @@ static int do_create_stash(const struct pathspec *ps, struct strbuf *stash_msg_b
|
||||
|
||||
strbuf_addf(&commit_tree_label, "index on %s\n", msg.buf);
|
||||
commit_list_insert(head_commit, &parents);
|
||||
if (write_index_as_tree(&info->i_tree, the_repository->index, get_index_file(), 0,
|
||||
NULL) ||
|
||||
if (write_index_as_tree(&info->i_tree, the_repository->index,
|
||||
repo_get_index_file(the_repository), 0, NULL) ||
|
||||
commit_tree(commit_tree_label.buf, commit_tree_label.len,
|
||||
&info->i_tree, parents, &info->i_commit, NULL, NULL)) {
|
||||
if (!quiet)
|
||||
@ -1904,7 +1905,7 @@ int cmd_stash(int argc, const char **argv, const char *prefix)
|
||||
prepare_repo_settings(the_repository);
|
||||
the_repository->settings.command_requires_full_index = 0;
|
||||
|
||||
index_file = get_index_file();
|
||||
index_file = repo_get_index_file(the_repository);
|
||||
strbuf_addf(&stash_index_path, "%s.stash.%" PRIuMAX, index_file,
|
||||
(uintmax_t)pid);
|
||||
|
||||
|
Reference in New Issue
Block a user