mirror of
https://github.com/LmeSzinc/AzurLaneAutoScript.git
synced 2025-01-07 07:47:07 +08:00
Fix: Remove lock files before git reset
This commit is contained in:
parent
dcb0c5eca7
commit
0bbfea6bd0
@ -208,6 +208,15 @@ class GitOverCdnClient:
|
||||
"""
|
||||
git reset --hard <commit>
|
||||
"""
|
||||
# Remove git lock
|
||||
for lock_file in [
|
||||
'./.git/index.lock',
|
||||
'./.git/HEAD.lock',
|
||||
'./.git/refs/heads/master.lock',
|
||||
]:
|
||||
if os.path.exists(lock_file):
|
||||
self.logger.info(f'Lock file {lock_file} exists, removing')
|
||||
os.remove(lock_file)
|
||||
if keep_changes:
|
||||
self.git_command('stash')
|
||||
self.git_command('reset', '--hard', f'{self.source}/{self.branch}')
|
||||
|
Loading…
Reference in New Issue
Block a user