From 6c8171f6f9ee1925c0462c3afc13e006ffd6d368 Mon Sep 17 00:00:00 2001 From: Anastasis Andronidis Date: Tue, 4 Sep 2012 16:28:57 +0300 Subject: [PATCH] Appended repo_path --- lib/ansible/utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ansible/utils.py b/lib/ansible/utils.py index 2f2f63196bd..4a9c046248a 100644 --- a/lib/ansible/utils.py +++ b/lib/ansible/utils.py @@ -326,9 +326,10 @@ def _gitinfo(): if os.path.exists(repo_path): ''' Check if the .git is a file. If it is a file, it means that we are in a submodule structure. ''' if os.path.isfile(repo_path): + repo_path = repo_path.split('.git')[0] central_gitdir = yaml.load(open(repo_path))['gitdir'].split('.git')[0] ''' There is a posibility the .git file to have an absolute path. ''' - repo_path = os.path.join(os.path.relpath(central_gitdir), '.git') + repo_path = os.path.join(repo_path, os.path.relpath(central_gitdir), '.git') f = open(os.path.join(repo_path, "HEAD")) branch = f.readline().split('/')[-1].rstrip("\n") f.close()