From: Antonio Ossa-Guerra Date: Sat, 5 Nov 2022 05:09:59 +0000 (-0300) Subject: Apply .gitignore correctly in every source entry (#3336) X-Git-Url: https://git.madduck.net/etc/vim.git/commitdiff_plain/0e9d29ab73d608a79028e22a713ee717b5dcca96?hp=0e9d29ab73d608a79028e22a713ee717b5dcca96 Apply .gitignore correctly in every source entry (#3336) When passing multiple src directories, the root gitignore was only applied to the first processed source. The reason is that, in the first source, exclude is `None`, but then the value gets overridden by `re_compile_maybe_verbose(DEFAULT_EXCLUDES)`, so in the next iteration where the source is a directory, the condition is not met and sets the value of `gitignore` to `None`. To fix this problem, we store a boolean indicating if `exclude` is `None` and set the value of `exclude` to its default value if that's the case. This makes sure that the flow enters the correct condition on following iterations and also keeps the original value if the condition is not met. Also, the value of `gitignore` is initialized as `None` and overriden if necessary. The value of `root_gitignore` is always calculated to avoid using additional variables (at the small cost of additional computations). Signed-off-by: Antonio Ossa Guerra ---