diff options
| author | Mike Frysinger <vapier@google.com> | 2026-10-23 20:10:19 -0400 |
|---|---|---|
| committer | gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2026-10-27 02:00:11 -0700 |
| commit | 338ddb7d83ea35d5aef94d3c5d95c74fa3845780 (patch) | |
| tree | e1d9fb1f0b5a7a6f2e051a09d7ee602b952ef38e /git_config.py | |
| parent | 8c316d7c980d7785578ed98e871dba3d7093b481 (diff) | |
| download | git-repo-2.71.tar.gz | |
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>
Diffstat (limited to 'git_config.py')
| -rw-r--r-- | git_config.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/git_config.py b/git_config.py index 0ad01f5ff..f3f1e5b8c 100644 --- a/git_config.py +++ b/git_config.py | |||
| @@ -28,9 +28,7 @@ import urllib.request | |||
| 28 | 28 | ||
| 29 | import error | 29 | import error |
| 30 | import git_command | 30 | import git_command |
| 31 | from git_refs import R_CHANGES | 31 | import git_refs |
| 32 | from git_refs import R_HEADS | ||
| 33 | from git_refs import R_TAGS | ||
| 34 | import platform_utils | 32 | import platform_utils |
| 35 | import repo_trace | 33 | import repo_trace |
| 36 | 34 | ||
| @@ -45,7 +43,7 @@ REVIEW_CACHE = {} | |||
| 45 | 43 | ||
| 46 | 44 | ||
| 47 | def IsChange(rev): | 45 | def IsChange(rev): |
| 48 | return rev.startswith(R_CHANGES) | 46 | return rev.startswith(git_refs.R_CHANGES) |
| 49 | 47 | ||
| 50 | 48 | ||
| 51 | def IsId(rev: str) -> bool: | 49 | def IsId(rev: str) -> bool: |
| @@ -53,7 +51,7 @@ def IsId(rev: str) -> bool: | |||
| 53 | 51 | ||
| 54 | 52 | ||
| 55 | def IsTag(rev): | 53 | def IsTag(rev): |
| 56 | return rev.startswith(R_TAGS) | 54 | return rev.startswith(git_refs.R_TAGS) |
| 57 | 55 | ||
| 58 | 56 | ||
| 59 | def IsImmutable(rev): | 57 | def IsImmutable(rev): |
| @@ -741,13 +739,13 @@ class Remote: | |||
| 741 | return rev | 739 | return rev |
| 742 | 740 | ||
| 743 | if not rev.startswith("refs/"): | 741 | if not rev.startswith("refs/"): |
| 744 | rev = R_HEADS + rev | 742 | rev = git_refs.R_HEADS + rev |
| 745 | 743 | ||
| 746 | for spec in self.fetch: | 744 | for spec in self.fetch: |
| 747 | if spec.SourceMatches(rev): | 745 | if spec.SourceMatches(rev): |
| 748 | return spec.MapSource(rev) | 746 | return spec.MapSource(rev) |
| 749 | 747 | ||
| 750 | if not rev.startswith(R_HEADS): | 748 | if not rev.startswith(git_refs.R_HEADS): |
| 751 | return rev | 749 | return rev |
| 752 | 750 | ||
| 753 | raise error.GitError( | 751 | raise error.GitError( |
