Skip to content

Commit 2ac2cf7

Browse files
committed
fix issue with LFS locking main thread
1 parent cc21865 commit 2ac2cf7

File tree

2 files changed

+19
-11
lines changed

2 files changed

+19
-11
lines changed

pbpy/pbgit.py

+10-2
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,13 @@ def get_locked(key="ours", include_new=True):
159159
# also check untracked and added files
160160
if key == "ours" and include_new:
161161
proc = pbtools.run_with_combined_output(
162-
[get_git_executable(), "status", "--porcelain", "-uall"]
162+
[
163+
get_git_executable(),
164+
"--no-optional-locks",
165+
"status",
166+
"--porcelain",
167+
"-uall",
168+
]
163169
)
164170
if not proc.returncode:
165171
for line in proc.stdout.splitlines():
@@ -394,7 +400,9 @@ def get_credentials(repo_str=None):
394400

395401

396402
def get_modified_files(paths=True):
397-
proc = pbtools.run_with_output([get_git_executable(), "status", "--porcelain"])
403+
proc = pbtools.run_with_output(
404+
[get_git_executable(), "--no-optional-locks", "status", "--porcelain"]
405+
)
398406
if paths:
399407
return {Path(line[3:]) for line in proc.stdout.splitlines()}
400408
return {line[3:] for line in proc.stdout.splitlines()}

pbsync/__main__.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -517,15 +517,6 @@ def sync_handler(sync_val: str, repository_val=None):
517517
symbols_needed = pbunreal.is_versionator_symbols_enabled()
518518
pbunreal.clean_binaries_folder(not symbols_needed)
519519

520-
configured_branches = pbconfig.get("branches")
521-
should_unlock_unmodified = (
522-
pbgit.get_current_branch_name() in configured_branches
523-
)
524-
fix_attr_thread = threading.Thread(
525-
target=pbgit.fix_lfs_ro_attr, args=(should_unlock_unmodified,)
526-
)
527-
fix_attr_thread.start()
528-
529520
pblog.info("------------------")
530521

531522
pblog.info("Checking for engine updates...")
@@ -535,6 +526,15 @@ def sync_handler(sync_val: str, repository_val=None):
535526
f"Something went wrong while updating the uproject file. Please request help in {pbconfig.get('support_channel')}."
536527
)
537528

529+
configured_branches = pbconfig.get("branches")
530+
should_unlock_unmodified = (
531+
pbgit.get_current_branch_name() in configured_branches
532+
)
533+
fix_attr_thread = threading.Thread(
534+
target=pbgit.fix_lfs_ro_attr, args=(should_unlock_unmodified,)
535+
)
536+
fix_attr_thread.start()
537+
538538
engine_version = pbunreal.get_engine_version_with_prefix()
539539
if engine_version is not None:
540540
pblog.info(

0 commit comments

Comments
 (0)