-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Fix import_from_git when specifying a tag and cache_path #22133
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
Fix import_from_git when specifying a tag and cache_path #22133
Conversation
Fix tag check after refactor to use `git rev-parse` because it will now return "HEAD" instead of an empty string when the current ref is a git tag.
@oct0f1sh thanks for fixing the CircleCI checks! How do I rerun the checks for my PR so my PR it appears "green"? Do I have to make a new commit to it? |
Nevermind, I found the "Sync fork" button in my PR which retriggered the CI checks 👍 |
@joshdholtz it looks like @oct0f1sh has become inactive on GitHub. Maybe you or some other maintainer can give this PR a quick look? Thanks in advance. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution 💪. Looks good to me :)
Thanks a lot @lucgrabowski <3 Together with this PR I also created another related PR about adding support for |
Checklist
bundle exec rspec
from the root directory to see all new and existing tests passbundle exec rubocop -a
to ensure the code style is validci/circleci
builds in the "All checks have passed" section of my PR (connect CircleCI to GitHub if not)Motivation and Context
Fixes #21142.
If you run
import_from_git
with a tag andcache_path
like this:It fails (for full error log see bottom of post):
Description
This PR avoids running
git rebase
whencache_path
is provided andbranch
is actually a git tag and not a branch - because you have to be on a branch in order to do a git rebase.I've tested my PR by both running
import_from_git
with thebranch
parameter being a git tag and a git branch and verified thatgit rebase
is still called whenbranch
is actually a branch and not called whenbranch
is a git tag:branch
is a git branch:branch
is a git tag:Testing Steps
See previous description on how to test this.
Full error log