Commit acb0fa8b94ef421ad60c8507b634759a472cd56c
- Diff rendering mode:
- inline
- side by side
TODO
(2 / 1)
|   | |||
| 13 | 13 | from a common base. This allows to easily add __eq__, __ne__, __hash__ method | |
| 14 | 14 | to make their use more comfortable and reduces code duplication. | |
| 15 | 15 | * References like Tag(Reference), Heads and Remotes should have an own Base class | |
| 16 | * Optimize type size by adding __slots__ ( at least ) | ||
| 16 | * Optimize type size by adding __slots__ ( at least ), which would also make sure | ||
| 17 | no one accidentally adds attributes to classes. | ||
| 17 | 18 | * Add more performance tests, see branch "performance_testing" | |
| 18 | 19 | ||
| 19 | 20 | Configuration |
lib/git/utils.py
(2 / 1)
|   | |||
| 10 | 10 | return string.replace('_', '-') | |
| 11 | 11 | ||
| 12 | 12 | def touch(filename): | |
| 13 | os.utime(filename) | ||
| 13 | fp = open(filename, 'a') | ||
| 14 | fp.close() | ||
| 14 | 15 | ||
| 15 | 16 | def is_git_dir(d): | |
| 16 | 17 | """ This is taken from the git setup.c:is_git_directory |
test/git/test_repo.py
(6 / 8)
|   | |||
| 198 | 198 | def test_archive_tar_gz(self): | |
| 199 | 199 | self.repo.archive_tar_gz() | |
| 200 | 200 | ||
| 201 | @patch('git.utils.touch') | ||
| 202 | def test_enable_daemon_serve(self, touch): | ||
| 203 | self.repo.daemon_serve = False | ||
| 204 | assert_false(self.repo.daemon_serve) | ||
| 205 | |||
| 206 | def test_disable_daemon_serve(self): | ||
| 207 | self.repo.daemon_serve = True | ||
| 208 | assert_true(self.repo.daemon_serve) | ||
| 201 | def test_disable_daemon_export(self): | ||
| 202 | prev_value = self.repo.daemon_export | ||
| 203 | self.repo.daemon_export = not prev_value | ||
| 204 | assert_equal(self.repo.daemon_export, not prev_value) | ||
| 205 | self.repo.daemon_export = prev_value | ||
| 206 | assert_equal(self.repo.daemon_export, prev_value) | ||
| 209 | 207 | ||
| 210 | 208 | def test_alternates(self): | |
| 211 | 209 | cur_alternates = self.repo.alternates |

