-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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 git command for dep which points to a tag #481
Conversation
dbt/clients/git.py
Outdated
else: | ||
spec = 'origin/{}'.format(branch) | ||
|
||
run_cmd(cwd, ['git', 'reset', '--hard', spec]) |
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.
can you also check the output of this and fail if this fails?
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.
@cmcarthur good idea!
dbt/clients/git.py
Outdated
def list_tags(cwd): | ||
out, err = run_cmd(cwd, ['git', 'tag', '--list']) | ||
tags = set(out.decode('utf-8').strip().split("\n")) | ||
return tags |
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.
clever
Previously, dbt would silently use
origin/master
if you tried to specify a tag for a package. This happened becauseremote_branch
was set toorigin/{tag-name}
, which is not the correct syntax forgit reset
on a tag.Instead, we want to use
git reset --hard tags/{tag-name}
.Fixes #463