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

+4 -4
View File
@@ -19,7 +19,7 @@ from typing import Any, Tuple
from command import Command
from command import MirrorSafeCommand
import git_command
from git_refs import HEAD
import git_refs
from wrapper import Wrapper
@@ -38,15 +38,15 @@ class Version(Command, MirrorSafeCommand):
"""Return repo's describe string and commit date."""
if git_command.git_require((2, 32, 0)):
output = project.bare_git.log(
"-1", "--format=%(describe)%n%cD", HEAD
"-1", "--format=%(describe)%n%cD", git_refs.HEAD
)
description, commit_date = output.rstrip("\n").split("\n", 1)
if description:
return description, commit_date
return (
project.bare_git.describe(HEAD),
project.bare_git.log("-1", "--format=%cD", HEAD),
project.bare_git.describe(git_refs.HEAD),
project.bare_git.log("-1", "--format=%cD", git_refs.HEAD),
)
def Execute(self, opt, args):