Merge pull request #977 from betatim/support-main-and-master

[MRG] Remove reference to `master` branch from CLI doc
pull/981/head
Min RK 2020-10-22 10:44:30 +02:00 zatwierdzone przez GitHub
commit 805c555173
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
2 zmienionych plików z 13 dodań i 3 usunięć

Wyświetl plik

@ -96,7 +96,8 @@ def get_argparser():
argparser.add_argument(
"--ref",
help=(
"If building a git url, which reference to check out. " "E.g., `master`."
"Reference to build instead of default reference. For example"
" branch name or commit for a Git repository."
),
)

Wyświetl plik

@ -47,9 +47,18 @@ class Git(ContentProvider):
self.log.error(
"Failed to check out ref %s", ref, extra=dict(phase="failed")
)
raise ValueError("Failed to check out ref {}".format(ref))
if ref == "master":
msg = (
"Failed to check out the 'master' branch. "
"Maybe the default branch is not named 'master' "
"for this repository.\n\nTry not explicitly "
"specifying `--ref`."
)
else:
msg = "Failed to check out ref {}".format(ref)
raise ValueError(msg)
# We don't need to explicitly checkout things as the reset will
# take of that. If the hash is resolved above, we should be
# take care of that. If the hash is resolved above, we should be
# able to reset to it
for line in execute_cmd(
["git", "reset", "--hard", hash], cwd=output_dir, capture=yield_output