diff options
author | Elijah Newren <newren@gmail.com> | 2023-02-27 15:28:09 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2023-02-27 08:29:50 -0800 |
commit | b413a827126abd54fa95470be7c63fa4f00d5d47 (patch) | |
tree | a4a20dc3d93b3123acc60d6ded50cf4a8e4a42f5 /commit.c | |
parent | 24a49cf78eef2a13bc3f7c730e236d58b5e2ebbe (diff) |
unpack-trees: heed requests to overwrite ignored files
When a directory exists but has only ignored files within it and we are
trying to switch to a branch that has a file where that directory is,
the behavior depends upon --[no]-overwrite-ignore. If the user wants to
--overwrite-ignore (the default), then we should delete the ignored file
and directory and switch to the new branch.
The code to handle this in verify_clean_subdirectory() in unpack-trees
tried to handle this via paying attention to the exclude_per_dir setting
of the internal dir field. This came from commit c81935348b ("Fix
switching to a branch with D/F when current branch has file D.",
2007-03-15), which pre-dated 039bc64e88 ("core.excludesfile clean-up",
2007-11-14), and thus did not pay attention to ignore patterns from
other relevant files. Change it to use setup_standard_excludes() so
that it is also aware of excludes specified in other locations.
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit.c')
0 files changed, 0 insertions, 0 deletions