瀏覽代碼

Fixes #320 - stash parser now handles single untracked files

main
Eric Amodio 6 年之前
父節點
當前提交
54c226c89e
共有 2 個文件被更改,包括 27 次插入26 次删除
  1. +1
    -0
      CHANGELOG.md
  2. +26
    -26
      src/git/parsers/stashParser.ts

+ 1
- 0
CHANGELOG.md 查看文件

@ -12,6 +12,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Marks temporary files (used when showing comparisions with previous revisions) as read-only to help avoid accidental edits/saving
### Fixed
- Fixes [#320](https://github.com/eamodio/vscode-gitlens/issues/320) - Stashes with a single untracked file created with "stash push" aren't shown in the GitLens explorer
- Fixes [#331](https://github.com/eamodio/vscode-gitlens/issues/331) - Code lens shows on every import in Python
- Fixes issues where quick pick menu progress indicators will get stuck in some cases because of a vscode api change in [Microsoft/vscode#46102](https://github.com/Microsoft/vscode/pull/46102)

+ 26
- 26
src/git/parsers/stashParser.ts 查看文件

@ -84,35 +84,35 @@ export class GitStashParser {
case 102: // 'f': // files
// Skip the blank line git adds before the files
next = lines.next();
if (next.done || next.value === '</f>') break;
while (true) {
next = lines.next();
if (next.done) break;
line = next.value;
if (line === '</f>') break;
if (line.startsWith('warning:')) continue;
const status = {
status: line[0] as GitStatusFileStatus,
fileName: line.substring(1),
originalFileName: undefined
} as IGitStatusFile;
GitLogParser.parseFileName(status);
if (status.fileName) {
if (entry.fileStatuses === undefined) {
entry.fileStatuses = [];
if (!next.done && next.value !== '</f>') {
while (true) {
next = lines.next();
if (next.done) break;
line = next.value;
if (line === '</f>') break;
if (line.startsWith('warning:')) continue;
const status = {
status: line[0] as GitStatusFileStatus,
fileName: line.substring(1),
originalFileName: undefined
} as IGitStatusFile;
GitLogParser.parseFileName(status);
if (status.fileName) {
if (entry.fileStatuses === undefined) {
entry.fileStatuses = [];
}
entry.fileStatuses.push(status);
}
entry.fileStatuses.push(status);
}
}
if (entry.fileStatuses !== undefined) {
entry.fileNames = Arrays.filterMap(entry.fileStatuses,
f => !!f.fileName ? f.fileName : undefined).join(', ');
if (entry.fileStatuses !== undefined) {
entry.fileNames = Arrays.filterMap(entry.fileStatuses,
f => !!f.fileName ? f.fileName : undefined).join(', ');
}
}
let commit = commits.get(entry.ref!);

Loading…
取消
儲存