From 5b02ca38a30298a963b3595f2cd884e11cf10c09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 10 Nov 2018 06:48:49 +0100 Subject: wt-status.c: remove implicit dependency on the_index MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/rebase.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'builtin/rebase.c') 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; -- cgit v1.2.1 From c207e9e1f6dd1802f0deadae51af5615d855edc4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 10 Nov 2018 06:49:02 +0100 Subject: cache-tree.c: remove the_repository references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This case is more interesting than other boring "remove the_repo" commits because while we need access to the object database, we cannot simply use r->index because unpack-trees.c can operate on a temporary index, not $GIT_DIR/index. Ideally we should be able to pass an object database to lookup_tree() but that ship has sailed. Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/rebase.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'builtin/rebase.c') diff --git a/builtin/rebase.c b/builtin/rebase.c index b9eb958454..d9bedecf86 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -582,7 +582,7 @@ static int reset_head(struct object_id *oid, const char *action, } tree = parse_tree_indirect(oid); - prime_cache_tree(the_repository->index, tree); + prime_cache_tree(the_repository, the_repository->index, tree); if (write_locked_index(the_repository->index, &lock, COMMIT_LOCK) < 0) ret = error(_("could not write index")); -- cgit v1.2.1 From 55e6b3547d4a678e56e3aef16ad3a3c90351325a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nguy=E1=BB=85n=20Th=C3=A1i=20Ng=E1=BB=8Dc=20Duy?= Date: Sat, 10 Nov 2018 06:49:09 +0100 Subject: rerere.c: remove the_repository references MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- builtin/rebase.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'builtin/rebase.c') diff --git a/builtin/rebase.c b/builtin/rebase.c index d9bedecf86..bc07d932a5 100644 --- a/builtin/rebase.c +++ b/builtin/rebase.c @@ -997,7 +997,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) options.action = "skip"; - rerere_clear(&merge_rr); + rerere_clear(the_repository, &merge_rr); string_list_clear(&merge_rr, 1); if (reset_head(NULL, "reset", NULL, 0, NULL, NULL) < 0) @@ -1010,7 +1010,7 @@ int cmd_rebase(int argc, const char **argv, const char *prefix) struct string_list merge_rr = STRING_LIST_INIT_DUP; options.action = "abort"; - rerere_clear(&merge_rr); + rerere_clear(the_repository, &merge_rr); string_list_clear(&merge_rr, 1); if (read_basic_state(&options)) -- cgit v1.2.1