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

+8 -5
View File
@@ -31,6 +31,7 @@ import utils_for_test
import error
import git_command
import git_config
import git_refs
import git_status
import git_trace2_event_log
import manifest_xml
@@ -3792,8 +3793,10 @@ class ReprojectCmdTests(unittest.TestCase):
proj.bare_ref = mock.MagicMock()
if branch:
proj.bare_ref.head = project.R_HEADS + branch
proj.bare_ref.all = {project.R_HEADS + branch: head} if head else {}
proj.bare_ref.head = git_refs.R_HEADS + branch
proj.bare_ref.all = (
{git_refs.R_HEADS + branch: head} if head else {}
)
# A branch that does not track upstream; tests that need one
# tracking upstream replace this with _tracking_branch().
proj.GetBranch = mock.MagicMock(
@@ -3806,7 +3809,7 @@ class ReprojectCmdTests(unittest.TestCase):
def _revlist(*args: Any, **kwargs: Any) -> List[str]:
if kwargs.get("format"):
return list(local_changes)
if project.not_rev(project.HEAD) in args:
if project.not_rev(git_refs.HEAD) in args:
if "--count" in args:
return [str(len(upstream_gain))]
return list(upstream_gain)
@@ -3909,7 +3912,7 @@ class ReprojectCmdTests(unittest.TestCase):
self.assertTrue(syncbuf.Finish())
proj._Reproject.assert_called_once_with(self.REVID, verbose=False)
proj.work_git.UpdateRef.assert_called_once_with(
project.HEAD,
git_refs.HEAD,
self.REVID,
old=self.HEAD_ID,
message=f"merge {self.REVID}: Fast-forward",
@@ -3956,7 +3959,7 @@ class ReprojectCmdTests(unittest.TestCase):
self.assertTrue(syncbuf.Finish())
proj._Reproject.assert_called_once_with(self.REVID, verbose=False)
proj.work_git.UpdateRef.assert_called_once_with(
project.HEAD,
git_refs.HEAD,
self.REVID,
old=self.HEAD_ID,
message=f"reset: moving to {self.REVID}",