summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2018-08-13 16:14:31 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-08-13 21:14:43 (GMT)
commit68f08b4b235d09a95604c6bc8349208b37a2f41e (patch)
tree20d3586e9c7954e1107a405021ac30212cc62878 /submodule.c
parentd17ef3a94e6ee33be568c33496a84f15fb5fd4ee (diff)
downloadgit-68f08b4b235d09a95604c6bc8349208b37a2f41e.zip
git-68f08b4b235d09a95604c6bc8349208b37a2f41e.tar.gz
git-68f08b4b235d09a95604c6bc8349208b37a2f41e.tar.bz2
submodule.c: use the right index instead of 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 'submodule.c')
-rw-r--r--submodule.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/submodule.c b/submodule.c
index 293efc2..50cbf5f 100644
--- a/submodule.c
+++ b/submodule.c
@@ -93,7 +93,7 @@ int update_path_in_gitmodules(const char *oldpath, const char *newpath)
if (!file_exists(GITMODULES_FILE)) /* Do nothing without .gitmodules */
return -1;
- if (is_gitmodules_unmerged(&the_index))
+ if (is_gitmodules_unmerged(the_repository->index))
die(_("Cannot change unmerged .gitmodules, resolve merge conflicts first"));
submodule = submodule_from_path(the_repository, &null_oid, oldpath);
@@ -127,7 +127,7 @@ int remove_path_from_gitmodules(const char *path)
if (!file_exists(GITMODULES_FILE)) /* Do nothing without .gitmodules */
return -1;
- if (is_gitmodules_unmerged(&the_index))
+ if (is_gitmodules_unmerged(the_repository->index))
die(_("Cannot change unmerged .gitmodules, resolve merge conflicts first"));
submodule = submodule_from_path(the_repository, &null_oid, path);
@@ -188,7 +188,7 @@ void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
if (ignore)
handle_ignore_submodules_arg(diffopt, ignore);
- else if (is_gitmodules_unmerged(&the_index))
+ else if (is_gitmodules_unmerged(the_repository->index))
diffopt->flags.ignore_submodules = 1;
}
}
@@ -258,7 +258,7 @@ int is_submodule_active(struct repository *repo, const char *path)
}
parse_pathspec(&ps, 0, 0, NULL, args.argv);
- ret = match_pathspec(&the_index, &ps, path, strlen(path), 0, NULL, 1);
+ ret = match_pathspec(repo->index, &ps, path, strlen(path), 0, NULL, 1);
argv_array_clear(&args);
clear_pathspec(&ps);