mirror of
https://github.com/truenas/scale-build.git
synced 2025-12-24 04:50:48 +00:00
Allow basic branch out functionality in packages
This commit is contained in:
@@ -26,3 +26,7 @@ def retrieve_git_branch(path):
|
||||
def branch_exists_in_repository(origin, branch):
|
||||
cp = run(['git', 'ls-remote', origin], log=False)
|
||||
return bool(re.findall(fr'/{branch}\n', cp.stdout, re.M))
|
||||
|
||||
|
||||
def create_branch(path, base_branch, new_branch):
|
||||
run(['git', '-C', path, 'checkout', '-b', new_branch, base_branch])
|
||||
|
||||
Reference in New Issue
Block a user