Skip to content

Commit 76fd1d4

Browse files
committed
LockFile: release_lock now checks whether the lockfile to be removed still exists. Previously it would just fail
1 parent 180a502 commit 76fd1d4

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/git/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,12 @@ def _release_lock(self):
166166
"""
167167
if not self._has_lock():
168168
return
169-
os.remove(self._lock_file_path())
169+
170+
# if someone removed our file beforhand, lets just flag this issue
171+
# instead of failing, to make it more usable.
172+
lfp = self._lock_file_path()
173+
if os.path.isfile(lfp):
174+
os.remove(lfp)
170175
self._owns_lock = False
171176

172177

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy