MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / refRejection

Function refRejection

graph-ui/src/impact/impact-model.ts:727–755  ·  view source on GitHub ↗
(ref: string)

Source from the content-addressed store, hash-verified

725 * und die Antwort darauf holt der Aufruf.
726 */
727export function refRejection(ref: string): string | undefined {
728 const value = ref.trim();
729 if (value.length === 0) {
730 return 'it is empty';
731 }
732 // eslint-disable-next-line no-control-regex
733 if (/[\u0000-\u0020\u007f~^:?*[\\]/.test(value)) {
734 return 'a git ref holds no space, no control character and none of ~ ^ : ? * [ \\';
735 }
736 if (value.startsWith('-')) {
737 return 'a git ref does not start with a dash';
738 }
739 if (value.startsWith('/') || value.endsWith('/') || value.includes('//')) {
740 return 'a git ref has no empty path component';
741 }
742 if (value.includes('..')) {
743 return 'a git ref holds no two consecutive dots';
744 }
745 if (value.includes('@{')) {
746 return 'a git ref holds no @{ sequence';
747 }
748 if (value.endsWith('.') || value.endsWith('.lock')) {
749 return 'a git ref ends in neither a dot nor .lock';
750 }
751 if (value === '@') {
752 return 'a git ref is not the single character @';
753 }
754 return undefined;
755}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected