mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-06 21:32:49 +00:00
Verify SHA in Shippable change detection.
This commit is contained in:
@@ -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]
|
||||
|
||||
Reference in New Issue
Block a user