From 4173608b58ef7246b5ecd8788152bfd7635bc18f Mon Sep 17 00:00:00 2001 From: Patrick Smith Date: Wed, 12 Mar 2014 13:28:39 -0400 Subject: [PATCH] git: Execute git commands in `dest` directory --- library/source_control/git | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/source_control/git b/library/source_control/git index 4f885c9400..65c799a5df 100644 --- a/library/source_control/git +++ b/library/source_control/git @@ -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): 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: return True else: @@ -291,7 +291,7 @@ def get_tags(git_path, module, dest): def is_remote_branch(git_path, module, dest, 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: return True else: