Skip to content

Commit 4fa5611

Browse files
authored
Git - handle the diff editor for untracked files now that we throw FileNotFound if the file does not exist (microsoft#236863)
1 parent fca210c commit 4fa5611

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

extensions/git/src/fileSystemProvider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,8 @@ export class GitFileSystemProvider implements FileSystemProvider {
192192
try {
193193
return await repository.buffer(sanitizeRef(ref, path, repository), path);
194194
} catch (err) {
195-
// File does not exist in git (ex: git ignored)
195+
// File does not exist in git. This could be
196+
// because the file is untracked or ignored
196197
throw FileSystemError.FileNotFound();
197198
}
198199
}

extensions/git/src/repository.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,13 +560,11 @@ class ResourceCommandResolver {
560560
switch (resource.type) {
561561
case Status.INDEX_MODIFIED:
562562
case Status.INDEX_RENAMED:
563-
case Status.INDEX_ADDED:
564563
case Status.INTENT_TO_RENAME:
565564
case Status.TYPE_CHANGED:
566565
return { original: toGitUri(resource.original, 'HEAD') };
567566

568567
case Status.MODIFIED:
569-
case Status.UNTRACKED:
570568
return { original: toGitUri(resource.resourceUri, '~') };
571569

572570
case Status.DELETED_BY_US:

0 commit comments

Comments
 (0)