summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--TODO3
-rw-r--r--lib/git/utils.py3
-rw-r--r--test/git/test_repo.py14
3 files changed, 10 insertions, 10 deletions
diff --git a/TODO b/TODO
index df8925b4..cd50e387 100644
--- a/TODO
+++ b/TODO
@@ -13,7 +13,8 @@ General
from a common base. This allows to easily add __eq__, __ne__, __hash__ method
to make their use more comfortable and reduces code duplication.
* References like Tag(Reference), Heads and Remotes should have an own Base class
-* Optimize type size by adding __slots__ ( at least )
+* Optimize type size by adding __slots__ ( at least ), which would also make sure
+ no one accidentally adds attributes to classes.
* Add more performance tests, see branch "performance_testing"
Configuration
diff --git a/lib/git/utils.py b/lib/git/utils.py
index 5d0ba8ca..8425a728 100644
--- a/lib/git/utils.py
+++ b/lib/git/utils.py
@@ -10,7 +10,8 @@ def dashify(string):
return string.replace('_', '-')
def touch(filename):
- os.utime(filename)
+ fp = open(filename, 'a')
+ fp.close()
def is_git_dir(d):
""" This is taken from the git setup.c:is_git_directory
diff --git a/test/git/test_repo.py b/test/git/test_repo.py
index 8927971a..abf17be8 100644
--- a/test/git/test_repo.py
+++ b/test/git/test_repo.py
@@ -198,14 +198,12 @@ class TestRepo(object):
def test_archive_tar_gz(self):
self.repo.archive_tar_gz()
- @patch('git.utils.touch')
- def test_enable_daemon_serve(self, touch):
- self.repo.daemon_serve = False
- assert_false(self.repo.daemon_serve)
-
- def test_disable_daemon_serve(self):
- self.repo.daemon_serve = True
- assert_true(self.repo.daemon_serve)
+ def test_disable_daemon_export(self):
+ prev_value = self.repo.daemon_export
+ self.repo.daemon_export = not prev_value
+ assert_equal(self.repo.daemon_export, not prev_value)
+ self.repo.daemon_export = prev_value
+ assert_equal(self.repo.daemon_export, prev_value)
def test_alternates(self):
cur_alternates = self.repo.alternates