MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / collapseXY

Function collapseXY

packages/agent-core/src/services/fs/fsGit.ts:135–159  ·  view source on GitHub ↗
(xy: string)

Source from the content-addressed store, hash-verified

133}
134
135function collapseXY(xy: string): FsGitStatus {
136 if (xy === '??') return 'untracked';
137 if (xy === '!!') return 'ignored';
138 const x = xy.charAt(0);
139 const y = xy.charAt(1);
140 const set = new Set([x, y]);
141
142 if (
143 xy === 'DD' ||
144 xy === 'AU' ||
145 xy === 'UD' ||
146 xy === 'UA' ||
147 xy === 'DU' ||
148 xy === 'AA' ||
149 xy === 'UU'
150 ) {
151 return 'conflicted';
152 }
153 if (set.has('D')) return 'deleted';
154 if (set.has('M') || set.has('T')) return 'modified';
155 if (set.has('R')) return 'renamed';
156 if (set.has('C')) return 'renamed';
157 if (set.has('A')) return 'added';
158 return 'clean';
159}
160
161function posix(p: string): string {
162 return p.split(path.sep).join('/');

Callers 1

parsePorcelainFunction · 0.85

Calls 1

hasMethod · 0.65

Tested by

no test coverage detected