Skip to content

Commit 68f08b4

Browse files
pcloudsgitster
authored andcommitted
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>
1 parent d17ef3a commit 68f08b4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

submodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ int update_path_in_gitmodules(const char *oldpath, const char *newpath)
9393
if (!file_exists(GITMODULES_FILE)) /* Do nothing without .gitmodules */
9494
return -1;
9595

96-
if (is_gitmodules_unmerged(&the_index))
96+
if (is_gitmodules_unmerged(the_repository->index))
9797
die(_("Cannot change unmerged .gitmodules, resolve merge conflicts first"));
9898

9999
submodule = submodule_from_path(the_repository, &null_oid, oldpath);
@@ -127,7 +127,7 @@ int remove_path_from_gitmodules(const char *path)
127127
if (!file_exists(GITMODULES_FILE)) /* Do nothing without .gitmodules */
128128
return -1;
129129

130-
if (is_gitmodules_unmerged(&the_index))
130+
if (is_gitmodules_unmerged(the_repository->index))
131131
die(_("Cannot change unmerged .gitmodules, resolve merge conflicts first"));
132132

133133
submodule = submodule_from_path(the_repository, &null_oid, path);
@@ -188,7 +188,7 @@ void set_diffopt_flags_from_submodule_config(struct diff_options *diffopt,
188188

189189
if (ignore)
190190
handle_ignore_submodules_arg(diffopt, ignore);
191-
else if (is_gitmodules_unmerged(&the_index))
191+
else if (is_gitmodules_unmerged(the_repository->index))
192192
diffopt->flags.ignore_submodules = 1;
193193
}
194194
}
@@ -258,7 +258,7 @@ int is_submodule_active(struct repository *repo, const char *path)
258258
}
259259

260260
parse_pathspec(&ps, 0, 0, NULL, args.argv);
261-
ret = match_pathspec(&the_index, &ps, path, strlen(path), 0, NULL, 1);
261+
ret = match_pathspec(repo->index, &ps, path, strlen(path), 0, NULL, 1);
262262

263263
argv_array_clear(&args);
264264
clear_pathspec(&ps);

0 commit comments

Comments
 (0)