MCPcopy
hub / github.com/esm-dev/esm.sh / prCommitFromHeader

Function prCommitFromHeader

server/path.go:386–400  ·  view source on GitHub ↗
(header http.Header)

Source from the content-addressed store, hash-verified

384}
385
386func prCommitFromHeader(header http.Header) string {
387 key := header.Get("x-commit-key")
388 if key == "" {
389 return ""
390 }
391 idx := strings.LastIndexByte(key, ':')
392 if idx < 0 || idx == len(key)-1 {
393 return ""
394 }
395 commit := key[idx+1:]
396 if !isCommitish(commit) {
397 return ""
398 }
399 return commit[:7]
400}

Callers 2

resolvePrPackageVersionFunction · 0.85
TestPrCommitFromHeaderFunction · 0.85

Calls 2

isCommitishFunction · 0.85
GetMethod · 0.65

Tested by 1

TestPrCommitFromHeaderFunction · 0.68