]> arthur.barton.de Git - bup.git/commitdiff
git.repo: don't unintentionally set global repodir
authorRob Browning <rlb@defaultvalue.org>
Wed, 31 Jan 2018 07:26:27 +0000 (01:26 -0600)
committerRob Browning <rlb@defaultvalue.org>
Thu, 1 Feb 2018 07:05:32 +0000 (01:05 -0600)
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>
lib/bup/git.py

index 70673a3d2f8377f1329d254cbb002b995c75ebd4..be9672210ee92e1e04d686b190040a774730c2f7 100644 (file)
@@ -134,7 +134,6 @@ def _git_date_str(epoch_sec, tz_offset_sec):
 
 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()')
@@ -142,7 +141,7 @@ def repo(sub = '', repo_dir=None):
     # 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)