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

Launch gitversion error message #4028

Merged
merged 12 commits into from Aug 12, 2022
Merged
20 changes: 17 additions & 3 deletions wandb/sdk/launch/utils.py
Expand Up @@ -430,12 +430,26 @@ def _fetch_git_repo(dst_dir: str, uri: str, version: Optional[str]) -> None:
except git.exc.GitCommandError as e:
raise ExecutionError(
"Unable to checkout version '%s' of git repo %s"
"- please ensure that the version exists in the repo. "
"- please ensure that the version exists in the repo. \n"
"Error: %s" % (version, uri, e)
)
else:
repo.create_head("master", origin.refs.master)
repo.heads.master.checkout()
version = "master" # change to "main" for current github practice?
gtarpenning marked this conversation as resolved.
Show resolved Hide resolved
try:
repo.create_head(version, origin.refs[version])
repo.heads[version].checkout()
except git.exc.GitCommandError as e:
raise ExecutionError(
gtarpenning marked this conversation as resolved.
Show resolved Hide resolved
"Unable to checkout version '%s' of git repo %s"
"- please ensure that the version exists in the repo. \n"
"Error: %s" % (version, uri, e)
)
except (AttributeError, IndexError) as e:
raise ExecutionError(
"Unable to checkout default version '%s' of git repo %s "
"- to specify a git version use: --git-version \n"
"Error: %s" % (version, uri, e)
)
repo.submodule_update(init=True, recursive=True)


Expand Down