Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

datasets_download try/catching the git-lfs prune for versions that do not support -f #2375

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src_python/habitat_sim/utils/datasets_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,7 +594,15 @@ def clone_repo_source(

# prune the repo to reduce wasted memory consumption
prune_command = "git lfs prune -f --recent"
subprocess.check_call(shlex.split(prune_command), cwd=version_dir)
try:
subprocess.check_call(shlex.split(prune_command), cwd=version_dir)
except subprocess.CalledProcessError as e:
# a response of status code 127 suggests a git-lfs version
# that does not support the -f flag
if "status 127" in str(e):
subprocess.check_call(
shlex.split("git lfs prune --recent"), cwd=version_dir
)


def checkout_repo_tag(repo: Repo, version_dir: str, tag: str):
Expand Down