Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix to use root gitignore in every source entry
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 set the new value of `exclude` is a new variable (`_exclude`). This prevents entering the wrong condition on the second iteration and also keeps the origina value if the condition is not met. Also, the value of both `_exclude` and `gitignore` is calculated only once by using `None` as default value. This help us to reduce the number of computations (only calculate the value once, if needed), and also retains the original value of `gitignore`, which is then merged with the value of `p_gitignore`. That's why we also define `_gitignore` to contain the result of the merge (add) operation. Signed-off-by: Antonio Ossa Guerra <aaossa@uc.cl>
- Loading branch information