summaryrefslogtreecommitdiffstats
path: root/git_config.py
diff options
context:
space:
mode:
authorGavin Mak <gavinmak@google.com>2026-08-25 09:04:41 -0700
committergerrit-scoped@luci-project-accounts.iam.gserviceaccount.com <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2026-09-02 17:41:05 -0700
commit948abc85bcfd3f73d6cec4160506af325f721b71 (patch)
treeeac286d41867ca68089f940191ae2b8c19e81e61 /git_config.py
parentc63a2f92fa9c01b1a58608a35f968da827b9ac3e (diff)
downloadgit-repo-948abc85bcfd3f73d6cec4160506af325f721b71.tar.gz
git_config: recognize only complete object IDs
Full Git object IDs are exactly 40 hexadecimal digits for SHA-1 or 64 for SHA-256. Stop treating every intermediate length as immutable, which could bypass normal ref resolution for invalid revision strings. Bug: 553599402 Change-Id: I41b4ce6b2bfe2a2d8b351c7f040ec0cf469b474b Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/623901 Reviewed-by: Brian Gan <brgan@google.com> Tested-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Gavin Mak <gavinmak@google.com>
Diffstat (limited to 'git_config.py')
-rw-r--r--git_config.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/git_config.py b/git_config.py
index 888ae888c..84d347b1a 100644
--- a/git_config.py
+++ b/git_config.py
@@ -40,7 +40,7 @@ from repo_trace import Trace
40# that is saved in the config. 40# that is saved in the config.
41SYNC_STATE_PREFIX = "repo.syncstate." 41SYNC_STATE_PREFIX = "repo.syncstate."
42 42
43ID_RE = re.compile(r"^[0-9a-f]{40,64}$") 43ID_RE = re.compile(r"^(?:[0-9a-f]{40}|[0-9a-f]{64})$")
44 44
45REVIEW_CACHE = {} 45REVIEW_CACHE = {}
46 46