MCPcopy Index your code
hub / github.com/coder/coder / lookupCommit

Method lookupCommit

scripts/releaser/github.go:122–130  ·  view source on GitHub ↗

lookupCommit returns PR metadata for a commit, trying the full SHA first and falling back to PR number for cherry-picked commits.

(fullSHA string, prNumber int)

Source from the content-addressed store, hash-verified

120// lookupCommit returns PR metadata for a commit, trying the full SHA
121// first and falling back to PR number for cherry-picked commits.
122func (m *prMetadataMaps) lookupCommit(fullSHA string, prNumber int) prMetadata {
123 if meta, ok := m.bySHA[fullSHA]; ok {
124 return meta
125 }
126 if prNumber > 0 {
127 return m.byNumber[prNumber]
128 }
129 return prMetadata{}
130}
131
132// ghBuildPRMetadataMap returns PR metadata indexed by both
133// merge-commit SHA and PR number for merged PRs targeting main.

Callers 1

runReleaseFunction · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected