fix: remove more locks
All checks were successful
build / trigger-build-image (push) Successful in 14s

This commit is contained in:
张泊明518370910136 2025-06-08 22:43:11 -04:00
parent 65a8a5d130
commit 2c1123892c
GPG Key ID: CA088E6D9284F870

View File

@ -90,6 +90,11 @@ class Git:
retry_interval = 2
while retry_interval and auto_retry:
try:
current_branch = ""
if repo.head.is_detached:
current_branch = repo.head.commit.hexsha
else:
current_branch = repo.active_branch.name
if clean_git_lock:
lock_files = [
"index.lock",
@ -98,7 +103,7 @@ class Git:
"logs/HEAD.lock",
"packed-refs.lock",
"config.lock",
f"{checkout_dest}.lock",
f"refs/remotes/origin/{current_branch}.lock",
]
for lock_file in lock_files:
lock_path = os.path.join(repo_dir, ".git", lock_file)