diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2015-01-06 10:43:25 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2015-01-06 10:43:25 +0100 |
commit | 45c1c99a22e95d730d3096c339d97181d314d6ca (patch) | |
tree | d25ccc9b7d37fa7bc5a76c995e525ae137110a42 /git/util.py | |
parent | 7297ff651c3cc6abf648b3fe730c2b5b1f3edbd3 (diff) | |
download | gitpython-45c1c99a22e95d730d3096c339d97181d314d6ca.tar.gz |
test_index works
Diffstat (limited to 'git/util.py')
-rw-r--r-- | git/util.py | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/git/util.py b/git/util.py index b3a22883..4de736d3 100644 --- a/git/util.py +++ b/git/util.py @@ -446,7 +446,7 @@ class IndexFileSHA1Writer(object): def __init__(self, f): self.f = f - self.sha1 = make_sha("") + self.sha1 = make_sha(b"") def write(self, data): self.sha1.update(data) @@ -490,10 +490,7 @@ class LockFile(object): def _has_lock(self): """:return: True if we have a lock and if the lockfile still exists :raise AssertionError: if our lock-file does not exist""" - if not self._owns_lock: - return False - - return True + return self._owns_lock def _obtain_lock_or_raise(self): """Create a lock file as flag for other instances, mark our instance as lock-holder @@ -531,7 +528,7 @@ class LockFile(object): # on bloody windows, the file needs write permissions to be removable. # Why ... if os.name == 'nt': - os.chmod(lfp, int("0777", 8)) + os.chmod(lfp, 0o777) # END handle win32 os.remove(lfp) except OSError: |