Add logger context for checkout target

This commit is contained in:
Waqar Ahmed
2021-05-05 00:33:30 +05:00
committed by Waqar Ahmed
parent 4249e4e37c
commit 77033c3cb8
7 changed files with 83 additions and 26 deletions

View File

@@ -14,15 +14,15 @@ def update_git_manifest(git_remote, git_sha, mode='a+'):
def retrieve_git_remote_and_sha(path):
return {
'url': run(['git', '-C', path, 'remote', 'get-url', 'origin']).stdout.strip(),
'sha': run(['git', '-C', path, 'rev-parse', '--short', 'HEAD']).stdout.strip(),
'url': run(['git', '-C', path, 'remote', 'get-url', 'origin'], log=False).stdout.strip(),
'sha': run(['git', '-C', path, 'rev-parse', '--short', 'HEAD'], log=False).stdout.strip(),
}
def retrieve_git_branch(path):
return run(['git', '-C', path, 'branch', '--show-current']).stdout.strip()
return run(['git', '-C', path, 'branch', '--show-current'], log=False).stdout.strip()
def branch_exists_in_repository(origin, branch):
cp = run(['git', 'ls-remote', origin])
cp = run(['git', 'ls-remote', origin], log=False)
return bool(re.findall(fr'/{branch}\n', cp.stdout, re.M))