MCPcopy Index your code
hub / github.com/sourcebot-dev/sourcebot / isGitRefValid

Function isGitRefValid

packages/web/src/features/git/utils.ts:4–6  ·  view source on GitHub ↗
(ref: string)

Source from the content-addressed store, hash-verified

2
3// @note: reject refs starting with '-' to prevent git flag injection.
4export const isGitRefValid = (ref: string): boolean => {
5 return !ref.startsWith('-');
6}
7
8// @note: we don't allow directory traversal
9// or null bytes in the path.

Callers 8

getFileSourceForRepoFunction · 0.90
getFileBlameFunction · 0.90
getDiffFunction · 0.90
listCommitsFunction · 0.90
getTreeFunction · 0.90
getCommitFunction · 0.90
getPathTypeFunction · 0.90
listCommitAuthorsFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected