summaryrefslogtreecommitdiff
path: root/lib/git/utils.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-02-18 14:33:51 +0100
committerSebastian Thiel <byronimo@gmail.com>2010-02-18 14:33:51 +0100
commit76fd1d4119246e2958c571d1f64c5beb88a70bd4 (patch)
tree185cab3debf49de7cf6d6d4b917f9d0b519a788b /lib/git/utils.py
parent180a5029bc3a2f0c1023c2c63b552766dc524c41 (diff)
downloadgitpython-76fd1d4119246e2958c571d1f64c5beb88a70bd4.tar.gz
LockFile: release_lock now checks whether the lockfile to be removed still exists. Previously it would just fail
Diffstat (limited to 'lib/git/utils.py')
-rw-r--r--lib/git/utils.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/git/utils.py b/lib/git/utils.py
index 60a4e079..5dc576be 100644
--- a/lib/git/utils.py
+++ b/lib/git/utils.py
@@ -166,7 +166,12 @@ class LockFile(object):
"""
if not self._has_lock():
return
- os.remove(self._lock_file_path())
+
+ # if someone removed our file beforhand, lets just flag this issue
+ # instead of failing, to make it more usable.
+ lfp = self._lock_file_path()
+ if os.path.isfile(lfp):
+ os.remove(lfp)
self._owns_lock = False