Fall back to non-annotated tags for pull requests
PATCH 1/1 Fall back to non-annotated tags for pull requests
Not everyone uses an annotated tag, so fallback to a direct ref tag if annotated tags fail.
Signed-off-by Mario Limonciello <[email protected]>
--- b4/pr.py | 4 ++++ 1 file changed, 4 insertions(+)
b4/pr.py +4 -0
@@ -71,7 +71,11 @@ def git_get_commit_id_from_repo_ref(repo, ref): lines = b4.git_get_command_lines(None, ['ls-remote', repo, 'refs/tags/%s^{}' % ref]) elif ref.find('tags/') == 0: + #try as an annotated tag first lines = b4.git_get_command_lines(None, ['ls-remote', repo, 'refs/%s^{}' % ref]) + if not lines: + # try it as a non-annotated tag, then + lines = b4.git_get_command_lines(None, ['ls-remote', repo, 'refs/%s' % ref]) else: # Grab it as a head and hope for the best
Signature · 1 line
2.41.0
Konstantin Ryabitsev
AppliedQuoted 4 lines · Mario Limonciello
Not everyone uses an annotated tag, so fallback to a direct ref tag if annotated tags fail.
Applied, thanks!
[1/1] Fall back to non-annotated tags for pull requests
commit: dc0c5559df0ba626dd42d4fe144419585ea609ba
Best regards,
Signature · 1 line
Konstantin Ryabitsev <[email protected]>