Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitacb0fa8

Browse files
committed
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
1 parenta2ec078 commitacb0fa8

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

‎TODO

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ General
1313
from a common base. This allows to easily add __eq__, __ne__, __hash__ method
1414
to make their use more comfortable and reduces code duplication.
1515
* 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.
1718
* Add more performance tests, see branch "performance_testing"
1819

1920
Configuration

‎lib/git/utils.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,8 @@ def dashify(string):
1010
returnstring.replace('_','-')
1111

1212
deftouch(filename):
13-
os.utime(filename)
13+
fp=open(filename,'a')
14+
fp.close()
1415

1516
defis_git_dir(d):
1617
""" This is taken from the git setup.c:is_git_directory

‎test/git/test_repo.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -198,14 +198,12 @@ def test_archive_tar(self):
198198
deftest_archive_tar_gz(self):
199199
self.repo.archive_tar_gz()
200200

201-
@patch('git.utils.touch')
202-
deftest_enable_daemon_serve(self,touch):
203-
self.repo.daemon_serve=False
204-
assert_false(self.repo.daemon_serve)
205-
206-
deftest_disable_daemon_serve(self):
207-
self.repo.daemon_serve=True
208-
assert_true(self.repo.daemon_serve)
201+
deftest_disable_daemon_export(self):
202+
prev_value=self.repo.daemon_export
203+
self.repo.daemon_export=notprev_value
204+
assert_equal(self.repo.daemon_export,notprev_value)
205+
self.repo.daemon_export=prev_value
206+
assert_equal(self.repo.daemon_export,prev_value)
209207

210208
deftest_alternates(self):
211209
cur_alternates=self.repo.alternates

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp