Skip to content

Commit

Permalink
fix issue with LFS locking main thread
Browse files Browse the repository at this point in the history
  • Loading branch information
mastercoms committed Aug 14, 2024
1 parent cc21865 commit 2ac2cf7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
12 changes: 10 additions & 2 deletions pbpy/pbgit.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,13 @@ def get_locked(key="ours", include_new=True):
# also check untracked and added files
if key == "ours" and include_new:
proc = pbtools.run_with_combined_output(
[get_git_executable(), "status", "--porcelain", "-uall"]
[
get_git_executable(),
"--no-optional-locks",
"status",
"--porcelain",
"-uall",
]
)
if not proc.returncode:
for line in proc.stdout.splitlines():
Expand Down Expand Up @@ -394,7 +400,9 @@ def get_credentials(repo_str=None):


def get_modified_files(paths=True):
proc = pbtools.run_with_output([get_git_executable(), "status", "--porcelain"])
proc = pbtools.run_with_output(
[get_git_executable(), "--no-optional-locks", "status", "--porcelain"]
)
if paths:
return {Path(line[3:]) for line in proc.stdout.splitlines()}
return {line[3:] for line in proc.stdout.splitlines()}
18 changes: 9 additions & 9 deletions pbsync/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -517,15 +517,6 @@ def sync_handler(sync_val: str, repository_val=None):
symbols_needed = pbunreal.is_versionator_symbols_enabled()
pbunreal.clean_binaries_folder(not symbols_needed)

configured_branches = pbconfig.get("branches")
should_unlock_unmodified = (
pbgit.get_current_branch_name() in configured_branches
)
fix_attr_thread = threading.Thread(
target=pbgit.fix_lfs_ro_attr, args=(should_unlock_unmodified,)
)
fix_attr_thread.start()

pblog.info("------------------")

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

configured_branches = pbconfig.get("branches")
should_unlock_unmodified = (
pbgit.get_current_branch_name() in configured_branches
)
fix_attr_thread = threading.Thread(
target=pbgit.fix_lfs_ro_attr, args=(should_unlock_unmodified,)
)
fix_attr_thread.start()

engine_version = pbunreal.get_engine_version_with_prefix()
if engine_version is not None:
pblog.info(
Expand Down

0 comments on commit 2ac2cf7

Please sign in to comment.