diff options
| author | Junio C Hamano <gitster@pobox.com> | 2021-10-13 15:15:57 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2021-10-13 15:15:57 -0700 |
| commit | a7c2daa06d6f7d8fd13a1d72f23741acbaeba522 (patch) | |
| tree | b1b0095d267b98188a7ae24ac77934298b665649 /builtin/submodule--helper.c | |
| parent | 1fdfb774aaaa0ee8acb0a1ec9b601e5a2d2999f1 (diff) | |
| parent | 0e29222e0c2f68118cdd3412515539b74433b732 (diff) | |
| download | git-a7c2daa06d6f7d8fd13a1d72f23741acbaeba522.tar.gz | |
Merge branch 'en/removing-untracked-fixes'
Various fixes in code paths that move untracked files away to make room.
* en/removing-untracked-fixes:
Documentation: call out commands that nuke untracked files/directories
Comment important codepaths regarding nuking untracked files/dirs
unpack-trees: avoid nuking untracked dir in way of locally deleted file
unpack-trees: avoid nuking untracked dir in way of unmerged file
Change unpack_trees' 'reset' flag into an enum
Remove ignored files by default when they are in the way
unpack-trees: make dir an internal-only struct
unpack-trees: introduce preserve_ignored to unpack_trees_options
read-tree, merge-recursive: overwrite ignored files by default
checkout, read-tree: fix leak of unpack_trees_options.dir
t2500: add various tests for nuking untracked files
Diffstat (limited to 'builtin/submodule--helper.c')
| -rw-r--r-- | builtin/submodule--helper.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/builtin/submodule--helper.c b/builtin/submodule--helper.c index d574d650af..6298cbdd4e 100644 --- a/builtin/submodule--helper.c +++ b/builtin/submodule--helper.c @@ -3086,6 +3086,10 @@ static int add_submodule(const struct add_data *add_data) prepare_submodule_repo_env(&cp.env_array); cp.git_cmd = 1; cp.dir = add_data->sm_path; + /* + * NOTE: we only get here if add_data->force is true, so + * passing --force to checkout is reasonable. + */ strvec_pushl(&cp.args, "checkout", "-f", "-q", NULL); if (add_data->branch) { |
