Skip to content

Commit 1d9eb89

Browse files
committed
Fixes untracked files not showing working status
1 parent 1ec4945 commit 1d9eb89

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/git/formatters/statusFormatter.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,7 @@ export class StatusFileFormatter extends Formatter<GitFile, StatusFormatOptions>
6262
}
6363

6464
get working() {
65-
const commit = (this._item as GitFileWithCommit).commit;
66-
const statusFile = commit === undefined ? this._item : commit.files[0];
65+
const statusFile = (this._item as GitFileWithCommit).commit?.files?.[0] ?? this._item;
6766

6867
let icon;
6968
if (statusFile.workingTreeStatus !== undefined && statusFile.indexStatus !== undefined) {

src/git/parsers/statusParser.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ export class GitStatusParser {
109109
files.push(this.parseStatusFile(repoPath, lineParts[1], lineParts.slice(10).join(' ')));
110110
break;
111111
case '?': // untracked
112-
files.push(this.parseStatusFile(repoPath, ' ?', lineParts.slice(1).join(' ')));
112+
files.push(this.parseStatusFile(repoPath, '??', lineParts.slice(1).join(' ')));
113113
break;
114114
}
115115
}

0 commit comments

Comments
 (0)