mirror of
https://github.com/explosion/spaCy.git
synced 2025-01-13 02:36:32 +03:00
small UX fixes
This commit is contained in:
parent
1fc5486792
commit
92f9d2f406
|
@ -332,14 +332,15 @@ def git_sparse_checkout(repo: str, subpath: str, dest: Path, *, branch: str = "m
|
||||||
# Looking for this 'rev-list' command in the git --help? Hah.
|
# Looking for this 'rev-list' command in the git --help? Hah.
|
||||||
cmd = f"git -C {tmp_dir} rev-list --objects --all --missing=print -- {subpath}"
|
cmd = f"git -C {tmp_dir} rev-list --objects --all --missing=print -- {subpath}"
|
||||||
ret = _attempt_run_command(cmd)
|
ret = _attempt_run_command(cmd)
|
||||||
repo = _from_http_to_git(repo)
|
git_repo = _from_http_to_git(repo)
|
||||||
# Now pass those missings into another bit of git internals
|
# Now pass those missings into another bit of git internals
|
||||||
missings = " ".join([x[1:] for x in ret.stdout.split() if x.startswith("?")])
|
missings = " ".join([x[1:] for x in ret.stdout.split() if x.startswith("?")])
|
||||||
if not missings:
|
if not missings:
|
||||||
err = f"Could not find any relevant files for '{subpath}'. Did you specify a correct and complete Git path?"
|
err = f"Could not find any relevant files for '{subpath}'. " \
|
||||||
|
f"Did you specify a correct and complete path within repo '{repo}'?"
|
||||||
msg.fail(err, exits=1)
|
msg.fail(err, exits=1)
|
||||||
cmd = f"git -C {tmp_dir} fetch-pack {repo} {missings}"
|
cmd = f"git -C {tmp_dir} fetch-pack {git_repo} {missings}"
|
||||||
_attempt_run_command(cmd, capture=True)
|
_attempt_run_command(cmd)
|
||||||
# And finally, we can checkout our subpath
|
# And finally, we can checkout our subpath
|
||||||
cmd = f"git -C {tmp_dir} checkout {branch} {subpath}"
|
cmd = f"git -C {tmp_dir} checkout {branch} {subpath}"
|
||||||
_attempt_run_command(cmd)
|
_attempt_run_command(cmd)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user