diff options
Diffstat (limited to 'lib/git/utils.py')
-rw-r--r-- | lib/git/utils.py | 7 |
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 |