diff --git a/src/git/parsers/statusParser.ts b/src/git/parsers/statusParser.ts index 2e9465e..a2e6b0c 100644 --- a/src/git/parsers/statusParser.ts +++ b/src/git/parsers/statusParser.ts @@ -110,8 +110,15 @@ export class GitStatusParser { } static parseStatusFile(repoPath: string, rawStatus: string, fileName: string, originalFileName?: string): GitStatusFile { - const indexStatus = rawStatus[0] !== '.' ? rawStatus[0].trim() : undefined; - const workTreeStatus = rawStatus[1] !== '.' ? rawStatus[1].trim() : undefined; + let indexStatus = rawStatus[0] !== '.' ? rawStatus[0].trim() : undefined; + if (indexStatus === '' || indexStatus === null) { + indexStatus = undefined; + } + + let workTreeStatus = rawStatus[1] !== '.' ? rawStatus[1].trim() : undefined; + if (workTreeStatus === '' || workTreeStatus === null) { + workTreeStatus = undefined; + } return new GitStatusFile( repoPath,