瀏覽代碼

Ensures missing status is undefined

main
Eric Amodio 7 年之前
父節點
當前提交
b7ead45d78
共有 1 個文件被更改,包括 9 次插入2 次删除
  1. +9
    -2
      src/git/parsers/statusParser.ts

+ 9
- 2
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,

Loading…
取消
儲存