-
Notifications
You must be signed in to change notification settings - Fork 193
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
Handle dirty local module repos by force checkout of commits and branches if needed #2734
Conversation
Codecov ReportAttention:
Additional details and impacted files☔ View full report in Codecov by Sentry. |
Thanks, that's a great addition, just tried to make it a bit more fail-safe. @mirpedrol: do you think we should ask first before we overwrite changes? |
@nf-core-bot changelog |
@mashehu Awesome, thanks! If you all would rather stash the changes and re-checkout, I'm more than happy to make those changes. |
A dirty local module repo is usually the result of an error during an installation/update, so nothing could actively be lost, maybe I am just a bit too paranoid... this is probably the better solution, instead of dragging an installation error along |
Looks good! but I agree with @mashehu I would prefer to first ask the user if they want to continue and delete changes. |
after a quick thought, new idea: because we use this function also in other contexts, we should check that we are in the modules repo in the if clause and then do a force checkout with a prompt and otherwise raise an errror to be on the save side |
Use a try/except block to catch
GitCommandError
errors when performinggit checkout
, where changes may need to be stashed or force the checkout. This should solve issues similar to #2656 and the need to userm -rf ~/.config/nfcore/nf-core/modules/
where the following error is observed:PR checklist
CHANGELOG.md
is updateddocs
is updated