Handle all git status codes in file class mapping
This commit is contained in:
parent
c0387ff0d3
commit
acdceaf083
1 changed files with 11 additions and 4 deletions
|
|
@ -866,10 +866,17 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
function getFileClass(status) {
|
function getFileClass(status) {
|
||||||
if (status === 'M') return 'git-file-modified';
|
// Git status is two characters: index status + working tree status
|
||||||
if (status === 'A') return 'git-file-added';
|
// Check first non-space character for primary classification
|
||||||
if (status === 'D') return 'git-file-deleted';
|
const char = status.trim()[0] || '';
|
||||||
if (status === '??') return 'git-file-untracked';
|
if (char === 'M') return 'git-file-modified';
|
||||||
|
if (char === 'A') return 'git-file-added';
|
||||||
|
if (char === 'D') return 'git-file-deleted';
|
||||||
|
if (char === 'R') return 'git-file-modified'; // Renamed treated as modified
|
||||||
|
if (char === 'C') return 'git-file-added'; // Copied treated as added
|
||||||
|
if (char === 'U') return 'git-file-modified'; // Unmerged treated as modified
|
||||||
|
if (char === '?') return 'git-file-untracked';
|
||||||
|
if (char === '!') return 'git-file-untracked'; // Ignored
|
||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue