summaryrefslogtreecommitdiffstats
path: root/git_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'git_config.py')
-rw-r--r--git_config.py12
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
29import error 29import error
30import git_command 30import git_command
31from git_refs import R_CHANGES 31import git_refs
32from git_refs import R_HEADS
33from git_refs import R_TAGS
34import platform_utils 32import platform_utils
35import repo_trace 33import repo_trace
36 34
@@ -45,7 +43,7 @@ REVIEW_CACHE = {}
45 43
46 44
47def IsChange(rev): 45def IsChange(rev):
48 return rev.startswith(R_CHANGES) 46 return rev.startswith(git_refs.R_CHANGES)
49 47
50 48
51def IsId(rev: str) -> bool: 49def IsId(rev: str) -> bool:
@@ -53,7 +51,7 @@ def IsId(rev: str) -> bool:
53 51
54 52
55def IsTag(rev): 53def IsTag(rev):
56 return rev.startswith(R_TAGS) 54 return rev.startswith(git_refs.R_TAGS)
57 55
58 56
59def IsImmutable(rev): 57def 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(