aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/stash.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/stash.c')
-rw-r--r--builtin/stash.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/builtin/stash.c b/builtin/stash.c
index 461cfaef39..f1acc918d0 100644
--- a/builtin/stash.c
+++ b/builtin/stash.c
@@ -20,6 +20,7 @@
#include "entry.h"
#include "preload-index.h"
#include "read-cache.h"
+#include "repository.h"
#include "rerere.h"
#include "revision.h"
#include "setup.h"
@@ -485,7 +486,7 @@ static void unstage_changes_unless_new(struct object_id *orig_tree)
" to make room.\n"),
ce->name, new_path.buf);
if (rename(ce->name, new_path.buf))
- die("Failed to move %s to %s\n",
+ die("Failed to move %s to %s",
ce->name, new_path.buf);
strbuf_release(&new_path);
}
@@ -540,8 +541,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) {
@@ -566,7 +567,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();
@@ -641,9 +642,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);
}
@@ -975,7 +976,7 @@ static int show_stash(int argc, const char **argv, const char *prefix)
}
log_tree_diff_flush(&rev);
- ret = diff_result_code(&rev.diffopt);
+ ret = diff_result_code(&rev);
cleanup:
strvec_clear(&revision_args);
@@ -1127,13 +1128,13 @@ static int check_changes_tracked_files(const struct pathspec *ps)
diff_setup_done(&rev.diffopt);
run_diff_index(&rev, DIFF_INDEX_CACHED);
- if (diff_result_code(&rev.diffopt)) {
+ if (diff_result_code(&rev)) {
ret = 1;
goto done;
}
run_diff_files(&rev, 0);
- if (diff_result_code(&rev.diffopt)) {
+ if (diff_result_code(&rev)) {
ret = 1;
goto done;
}
@@ -1406,8 +1407,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)
@@ -1908,7 +1909,7 @@ int cmd_stash(int argc,
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);