summaryrefslogtreecommitdiff
path: root/test/git/test_index.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-12-03 16:31:07 +0100
committerSebastian Thiel <byronimo@gmail.com>2009-12-03 16:31:07 +0100
commitc05ef0e7543c2845fd431420509476537fefe2b0 (patch)
tree75393ae080690acd035108d698d3c5a467076ebb /test/git/test_index.py
parent1eae9d1532e037a4eb08aaee79ff3233d2737f31 (diff)
downloadgitpython-c05ef0e7543c2845fd431420509476537fefe2b0.tar.gz
repo: renamed directories to more descriptive identifiers and made them safer to use in case of bare repositories
Diffstat (limited to 'test/git/test_index.py')
-rw-r--r--test/git/test_index.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/test/git/test_index.py b/test/git/test_index.py
index 3a7edc7e..459cfc0e 100644
--- a/test/git/test_index.py
+++ b/test/git/test_index.py
@@ -254,7 +254,7 @@ class TestTree(TestBase):
# reset the working copy as well to current head,to pull 'back' as well
new_data = "will be reverted"
- file_path = os.path.join(rw_repo.git.git_dir, "CHANGES")
+ file_path = os.path.join(rw_repo.working_tree_dir, "CHANGES")
fp = open(file_path, "wb")
fp.write(new_data)
fp.close()
@@ -269,7 +269,7 @@ class TestTree(TestBase):
fp.close()
# test full checkout
- test_file = os.path.join(rw_repo.git.git_dir, "CHANGES")
+ test_file = os.path.join(rw_repo.working_tree_dir, "CHANGES")
open(test_file, 'ab').write("some data")
rval = index.checkout(None, force=True, fprogress=self._fprogress)
assert 'CHANGES' in list(rval)
@@ -312,7 +312,7 @@ class TestTree(TestBase):
assert not open(test_file).read().endswith(append_data)
# checkout directory
- shutil.rmtree(os.path.join(rw_repo.git.git_dir, "lib"))
+ shutil.rmtree(os.path.join(rw_repo.working_tree_dir, "lib"))
rval = index.checkout('lib')
assert len(list(rval)) > 1
@@ -321,7 +321,7 @@ class TestTree(TestBase):
Returns count of files that actually exist in the repository directory.
"""
existing = 0
- basedir = repo.git.git_dir
+ basedir = repo.working_tree_dir
for f in files:
existing += os.path.isfile(os.path.join(basedir, f))
# END for each deleted file
@@ -375,7 +375,7 @@ class TestTree(TestBase):
self.failUnlessRaises(TypeError, index.remove, [1])
# absolute path
- deleted_files = index.remove([os.path.join(rw_repo.git.git_dir,"lib")], r=True)
+ deleted_files = index.remove([os.path.join(rw_repo.working_tree_dir,"lib")], r=True)
assert len(deleted_files) > 1
self.failUnlessRaises(ValueError, index.remove, ["/doesnt/exists"])
@@ -411,7 +411,7 @@ class TestTree(TestBase):
index.reset(new_commit.parents[0], working_tree=True).reset(new_commit, working_tree=False)
lib_file_path = "lib/git/__init__.py"
assert (lib_file_path, 0) not in index.entries
- assert os.path.isfile(os.path.join(rw_repo.git.git_dir, lib_file_path))
+ assert os.path.isfile(os.path.join(rw_repo.working_tree_dir, lib_file_path))
# directory
entries = index.add(['lib'], fprogress=self._fprogress_add)
@@ -452,7 +452,7 @@ class TestTree(TestBase):
# add symlink
if sys.platform != "win32":
- link_file = os.path.join(rw_repo.git.git_dir, "my_real_symlink")
+ link_file = os.path.join(rw_repo.working_tree_dir, "my_real_symlink")
os.symlink("/etc/that", link_file)
entries = index.reset(new_commit).add([link_file], fprogress=self._fprogress_add)
self._assert_fprogress(entries)