summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-11-10 06:48:49 +0100
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-11-12 14:50:05 +0900
commit5b02ca38a30298a963b3595f2cd884e11cf10c09 (patch)
tree27e8e4a3773307ff5087ec29c3ecbb5982350004 /builtin
parentNinth batch for 2.20 (diff)
downloadtgif-5b02ca38a30298a963b3595f2cd884e11cf10c09.tar.xz
wt-status.c: remove implicit dependency on the_index
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/commit.c2
-rw-r--r--builtin/pull.c3
-rw-r--r--builtin/rebase.c7
3 files changed, 7 insertions, 5 deletions
diff --git a/builtin/commit.c b/builtin/commit.c
index 074bd9a551..6637a928a7 100644
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -185,7 +185,7 @@ static void determine_whence(struct wt_status *s)
static void status_init_config(struct wt_status *s, config_fn_t fn)
{
- wt_status_prepare(s);
+ wt_status_prepare(the_repository, s);
init_diff_ui_defaults();
git_config(fn, s);
determine_whence(s);
diff --git a/builtin/pull.c b/builtin/pull.c
index c21aa276f1..6026ce1a69 100644
--- a/builtin/pull.c
+++ b/builtin/pull.c
@@ -888,7 +888,8 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
die(_("Updating an unborn branch with changes added to the index."));
if (!autostash)
- require_clean_work_tree(N_("pull with rebase"),
+ require_clean_work_tree(the_repository,
+ N_("pull with rebase"),
_("please commit or stash them."), 1, 0);
if (get_rebase_fork_point(&rebase_fork_point, repo, *refspecs))
diff --git a/builtin/rebase.c b/builtin/rebase.c
index 0ee06aa363..b9eb958454 100644
--- a/builtin/rebase.c
+++ b/builtin/rebase.c
@@ -983,7 +983,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
&lock_file);
rollback_lock_file(&lock_file);
- if (has_unstaged_changes(1)) {
+ if (has_unstaged_changes(the_repository, 1)) {
puts(_("You must edit all merge conflicts and then\n"
"mark them as resolved using git add"));
exit(1);
@@ -1351,7 +1351,8 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
update_index_if_able(&the_index, &lock_file);
rollback_lock_file(&lock_file);
- if (has_unstaged_changes(1) || has_uncommitted_changes(1)) {
+ if (has_unstaged_changes(the_repository, 1) ||
+ has_uncommitted_changes(the_repository, 1)) {
const char *autostash =
state_dir_path("autostash", &options);
struct child_process stash = CHILD_PROCESS_INIT;
@@ -1397,7 +1398,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix)
}
}
- if (require_clean_work_tree("rebase",
+ if (require_clean_work_tree(the_repository, "rebase",
_("Please commit or stash them."), 1, 1)) {
ret = 1;
goto cleanup;