Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix
fetch_git_dependency()
to clobber files in the destination if `…
…force_fetch=True` (#1232) ## Proposed Changes When force fetching Git dependencies, we need to be able to overwrite read-only files in the destination, since Git repos may contain read-only pack and index files in `.git/`. To do so, this PR introduces flag `clobber_files` for `utils.copy_tree()` which will completely clobber existing files in the destination by setting a custom `copy_function` for `shutil.copytree()` which deletes existing destination files before copying them with `shutil.copy2()`. With this change, `utils.copy_tree()` with `clobber_files=True` behaves pretty much identically to distutils' `copy_tree()` which was used in previous versions of Kapitan. ## TODO - [x] Rebase once #1231 is merged ## Docs and Tests * [x] Tests added * [x] Updated documentation
- Loading branch information