style: use import git_refs everywhere

Align with Google style guides and `import git_refs` as a module
rather than import symbols out of it.

Change-Id: I4e33ebdf3b06acd94494f32cdf39aa58427cd4b2
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/648703
Reviewed-by: Brian Gan <brgan@google.com>
Commit-Queue: Mike Frysinger <vapier@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
Mike Frysinger authored and gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com committed 2026-10-27 02:00:11 -07:00
1 parent 8c316d7c98
commit 338ddb7d83
9 files changed
+144 -129

No files matched your search

+7 -5
View File
@@ -62,8 +62,7 @@ import event_log
import git_command
from git_config import GetUrlCookieFile
from git_config import RepoConfig
from git_refs import HEAD
from git_refs import R_HEADS
import git_refs
import git_superproject
from hooks import RepoHook
from manifest_xml import XmlManifest
@@ -866,8 +865,8 @@ later is required to fix a server side protocol bug.
"""
b = manifest_project.GetBranch(manifest_project.CurrentBranch)
branch = b.merge
if branch.startswith(R_HEADS):
branch = branch[len(R_HEADS) :]
if branch.startswith(git_refs.R_HEADS):
branch = branch[len(git_refs.R_HEADS) :]
return branch
@classmethod
@@ -3501,7 +3500,10 @@ def _PostRepoFetch(rp, repo_verify=True, verbose=False):
logger.warning("warning: Skipped upgrade to unverified version")
else:
if verbose:
print("repo version %s is current" % rp.work_git.describe(HEAD))
print(
"repo version %s is current"
% rp.work_git.describe(git_refs.HEAD)
)
class _FetchTimes: