1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

git: Execute git commands in dest directory

This commit is contained in:
Patrick Smith 2014-03-12 13:28:39 -04:00
parent ebfc776533
commit 4173608b58

View file

@ -263,7 +263,7 @@ def get_remote_head(git_path, module, dest, version, remote, bare):
def is_remote_tag(git_path, module, dest, remote, version): def is_remote_tag(git_path, module, dest, remote, version):
cmd = '%s ls-remote %s -t refs/tags/%s' % (git_path, remote, version) cmd = '%s ls-remote %s -t refs/tags/%s' % (git_path, remote, version)
(rc, out, err) = module.run_command(cmd, check_rc=True) (rc, out, err) = module.run_command(cmd, check_rc=True, cwd=dest)
if version in out: if version in out:
return True return True
else: else:
@ -291,7 +291,7 @@ def get_tags(git_path, module, dest):
def is_remote_branch(git_path, module, dest, remote, version): def is_remote_branch(git_path, module, dest, remote, version):
cmd = '%s ls-remote %s -h refs/heads/%s' % (git_path, remote, version) cmd = '%s ls-remote %s -h refs/heads/%s' % (git_path, remote, version)
(rc, out, err) = module.run_command(cmd, check_rc=True) (rc, out, err) = module.run_command(cmd, check_rc=True, cwd=dest)
if version in out: if version in out:
return True return True
else: else: