зеркало из https://github.com/microsoft/git.git
submodule: convert stage_updated_gitmodules to take a struct index_state
Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Родитель
95ec6b1b33
Коммит
3b8317a9e6
|
@ -291,7 +291,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gitmodules_modified)
|
if (gitmodules_modified)
|
||||||
stage_updated_gitmodules();
|
stage_updated_gitmodules(&the_index);
|
||||||
|
|
||||||
if (active_cache_changed &&
|
if (active_cache_changed &&
|
||||||
write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
|
write_locked_index(&the_index, &lock_file, COMMIT_LOCK))
|
||||||
|
|
|
@ -382,7 +382,7 @@ int cmd_rm(int argc, const char **argv, const char *prefix)
|
||||||
}
|
}
|
||||||
strbuf_release(&buf);
|
strbuf_release(&buf);
|
||||||
if (gitmodules_modified)
|
if (gitmodules_modified)
|
||||||
stage_updated_gitmodules();
|
stage_updated_gitmodules(&the_index);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (active_cache_changed) {
|
if (active_cache_changed) {
|
||||||
|
|
|
@ -143,9 +143,9 @@ int remove_path_from_gitmodules(const char *path)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void stage_updated_gitmodules(void)
|
void stage_updated_gitmodules(struct index_state *istate)
|
||||||
{
|
{
|
||||||
if (add_file_to_cache(GITMODULES_FILE, 0))
|
if (add_file_to_index(istate, GITMODULES_FILE, 0))
|
||||||
die(_("staging updated .gitmodules failed"));
|
die(_("staging updated .gitmodules failed"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ extern int is_gitmodules_unmerged(const struct index_state *istate);
|
||||||
extern int is_staging_gitmodules_ok(const struct index_state *istate);
|
extern int is_staging_gitmodules_ok(const struct index_state *istate);
|
||||||
extern int update_path_in_gitmodules(const char *oldpath, const char *newpath);
|
extern int update_path_in_gitmodules(const char *oldpath, const char *newpath);
|
||||||
extern int remove_path_from_gitmodules(const char *path);
|
extern int remove_path_from_gitmodules(const char *path);
|
||||||
extern void stage_updated_gitmodules(void);
|
extern void stage_updated_gitmodules(struct index_state *istate);
|
||||||
extern void set_diffopt_flags_from_submodule_config(struct diff_options *,
|
extern void set_diffopt_flags_from_submodule_config(struct diff_options *,
|
||||||
const char *path);
|
const char *path);
|
||||||
extern int git_default_submodule_config(const char *var, const char *value, void *cb);
|
extern int git_default_submodule_config(const char *var, const char *value, void *cb);
|
||||||
|
|
Загрузка…
Ссылка в новой задаче