Stop setting the global repodir when probing for and finding a .git/
subdirectory.
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
def repo(sub = '', repo_dir=None):
"""Get the path to the git repository or one of its subdirectories."""
- global repodir
repo_dir = repo_dir or repodir
if not repo_dir:
raise GitError('You should call check_repo_or_die()')
# If there's a .git subdirectory, then the actual repo is in there.
gd = os.path.join(repo_dir, '.git')
if os.path.exists(gd):
- repodir = gd
+ repo_dir = gd
return os.path.join(repo_dir, sub)