Skip to content

Commit 1b44082

Browse files
committed
repo-TC: FIX HOME-expansion check, Appveyor has no HOME var
1 parent 06b1611 commit 1b44082

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

Diff for: git/test/test_repo.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -486,16 +486,17 @@ def test_comparison_and_hash(self):
486486

487487
@with_rw_directory
488488
def test_tilde_and_env_vars_in_repo_path(self, rw_dir):
489-
ph = os.environ['HOME']
489+
ph = os.environ.get('HOME')
490490
try:
491491
os.environ['HOME'] = rw_dir
492492
Repo.init(os.path.join('~', 'test.git'), bare=True)
493493

494494
os.environ['FOO'] = rw_dir
495495
Repo.init(os.path.join('$FOO', 'test.git'), bare=True)
496496
finally:
497-
os.environ['HOME'] = ph
498-
del os.environ['FOO']
497+
if ph:
498+
os.environ['HOME'] = ph
499+
del os.environ['FOO']
499500
# end assure HOME gets reset to what it was
500501

501502
def test_git_cmd(self):

0 commit comments

Comments
 (0)