Skip to content

Commit

Permalink
fix #8106:fix open deleted file in git scm errors
Browse files Browse the repository at this point in the history
Signed-off-by: 二凢 <dingyu.wdy@alibaba-inc.com>
  • Loading branch information
datou0412 authored and westbury committed Jul 13, 2020
1 parent 37e0437 commit a1ea230
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/git/src/browser/git-scm-provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,13 @@ export class GitScmProvider implements ScmProvider {

getUriToOpen(change: GitFileChange): URI {
const changeUri: URI = new URI(change.uri);
if (change.status === GitFileStatus.Deleted) {
if (change.staged) {
return changeUri.withScheme(GIT_RESOURCE_SCHEME).withQuery('HEAD');
} else {
return changeUri.withScheme(GIT_RESOURCE_SCHEME);
}
}
if (change.status !== GitFileStatus.New) {
if (change.staged) {
return DiffUris.encode(
Expand Down

0 comments on commit a1ea230

Please sign in to comment.