mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-09 23:00:02 -07:00
Verify SHA in Shippable change detection.
This commit is contained in:
parent
273786d0bd
commit
5e9a2b8528
2 changed files with 18 additions and 3 deletions
|
@ -4,6 +4,7 @@ from __future__ import absolute_import, print_function
|
|||
|
||||
from lib.util import (
|
||||
CommonConfig,
|
||||
SubprocessError,
|
||||
run_command,
|
||||
)
|
||||
|
||||
|
@ -55,6 +56,18 @@ class Git(object):
|
|||
cmd = ['merge-base', '--fork-point', branch]
|
||||
return self.run_git(cmd).strip()
|
||||
|
||||
def is_valid_ref(self, ref):
|
||||
"""
|
||||
:type ref: str
|
||||
:rtype: bool
|
||||
"""
|
||||
cmd = ['show', ref]
|
||||
try:
|
||||
self.run_git(cmd)
|
||||
return True
|
||||
except SubprocessError:
|
||||
return False
|
||||
|
||||
def run_git_split(self, cmd, separator=None):
|
||||
"""
|
||||
:type cmd: list[str]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue