| 133 | } |
| 134 | |
| 135 | function 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 | |
| 161 | function posix(p: string): string { |
| 162 | return p.split(path.sep).join('/'); |