summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-21 14:54:59 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-21 14:54:59 +0200
commitacb0fa8b94ef421ad60c8507b634759a472cd56c (patch)
tree0ad47c627f30b1c9f3e262ee0da51249bdc9f2ba
parenta2ec078f25eb357edd1912ca3dbd578979a51226 (diff)
downloadgitpython-acb0fa8b94ef421ad60c8507b634759a472cd56c.tar.gz
Fixed utils.touch which did not work as the 'time' arg was missing, and even if added the method fails if the file does not exist ( at least on linux )
repo.daemon_export: fixed test for it which still used the daemon_serve property that does not exist
-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