From 3a2220425551b01fa7365676c5b9ee1d68fd1f8b Mon Sep 17 00:00:00 2001 From: mprahl Date: Mon, 29 Apr 2019 15:45:53 -0400 Subject: [PATCH] Clean up a comment in SCM.get_latest --- module_build_service/scm.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/module_build_service/scm.py b/module_build_service/scm.py index fe464a71..19c7eb9b 100644 --- a/module_build_service/scm.py +++ b/module_build_service/scm.py @@ -209,12 +209,9 @@ class SCM(object): if self.scheme == "git": log.debug("Getting/verifying commit hash for %s" % self.repository) try: - # This will fail if `ref` is not a branch name, but for example commit hash. - # It is valid use-case to use commit hashes in modules instead of branch names - # and in this case, there is no other way to get the full commit hash then - # fallbac to `get_full_commit_hash`. We do not want to retry here, because - # in case module contains only commit hashes, it would block for very long - # time. + # This will fail if `ref` is not a branch name, but this works for commit hashes. + # If the ref is not a branch, then fallback to `get_full_commit_hash`. We do not + # want to retry here, since if it's a commit, it would block for a very long time. cmd = ["git", "ls-remote", "--exit-code", self.repository, "refs/heads/" + ref] log.debug("Checking to see if the ref %s is a branch with `%s`", ref, " ".join(cmd)) _, output, _ = SCM._run_without_retry(cmd)