From 684352926bc53fc3b397726f4d45949bc09fe188 Mon Sep 17 00:00:00 2001 From: James Laska Date: Tue, 30 Sep 2014 10:33:42 -0400 Subject: [PATCH] Resolve issue where repo_path contains multiple '.git' strings If the repo_path contained multiple '.git' strings, the _git_repo_info() call resulted in a traceback. This change removes the trailing '.git' and resolves the traceback. --- lib/ansible/utils/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ansible/utils/__init__.py b/lib/ansible/utils/__init__.py index fb43005885f..f18ba876b1d 100644 --- a/lib/ansible/utils/__init__.py +++ b/lib/ansible/utils/__init__.py @@ -845,7 +845,7 @@ def _git_repo_info(repo_path): if os.path.isabs(gitdir): repo_path = gitdir else: - repo_path = os.path.join(repo_path.split('.git')[0], gitdir) + repo_path = os.path.join(repo_path[:-4], gitdir) except (IOError, AttributeError): return '' f = open(os.path.join(repo_path, "HEAD"))