-
Notifications
You must be signed in to change notification settings - Fork 286
support force-cleaning git repos #632
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
These were nearly sorted to start with.
Before this change, tests for 'ensure' values other than 'present' are
nested under 'when with an ensure of present', resulting in:
Puppet::Type::Vcsrepo::ProviderGit
when with an ensure of present
when with an ensure of present - with a revision that is a remote branch
executes 'git clone' and 'git checkout -b'
[...]
when with an ensure of bare - with revision
raises an error
when with an ensure of bare - without revision
justs execute 'git clone --bare'
when with an ensure of bare - without a source
executes 'git init --bare'
when with an ensure of mirror - with revision
raises an error
when with an ensure of mirror - without revision
justs execute 'git clone --mirror'
when with an ensure of mirror - without a source
raises an exeption
when with an ensure of mirror - with multiple remotes
executes 'git clone --mirror' and set all remotes to mirror
Neither of these tests set `ensure` to any value.
98ef182 to
c46c9eb
Compare
|
There are a couple things I couldn't do quite as well as I would like.
I don't think either of these issues should gate merging the PR, but I'm definitely willing to try any suggestions. Thank you, |
|
The remaining acceptance test failures seem to be unrelated to this PR. -Corey |
|
I updated the PR to support cleaning submodules as well. |
|
Changes in new update:
-Corey |
This resets changes to both tracked and un-tracked files. Submodules are cleaned as well, when enabled. For untracked files, 'git clean -fd' should have the most reasonably expected result (files in .gitignore are still ignored). This change is written to support other cleaning methods in the future, if desired.
|
Changes in new update:
-Corey |
Summary
Add support to vcsrepo's git provider to enforce the status of the git repo. The supported statuses are "default_clean" (to clean the repo, while ignoring files in
.gitignoreand "ignore" (to do nothing).Additional Context
This change is written to support other cleaning methods in the future, if desired.
The first commits fix up the existing documentation and unit tests a bit, then the last commit adds the new feature.
Checklist
puppet apply)