Git - handle the diff editor for untracked files now that we throw `FileNotFound` if the file does not exist (#236863)

pull/236683/head^2
Ladislau Szomoru 2024-12-24 02:02:40 +01:00 committed by GitHub
parent fca210cd10
commit 4fa5611d67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 2 additions and 3 deletions

View File

@ -192,7 +192,8 @@ export class GitFileSystemProvider implements FileSystemProvider {
try {
return await repository.buffer(sanitizeRef(ref, path, repository), path);
} catch (err) {
// File does not exist in git (ex: git ignored)
// File does not exist in git. This could be
// because the file is untracked or ignored
throw FileSystemError.FileNotFound();
}
}

View File

@ -560,13 +560,11 @@ class ResourceCommandResolver {
switch (resource.type) {
case Status.INDEX_MODIFIED:
case Status.INDEX_RENAMED:
case Status.INDEX_ADDED:
case Status.INTENT_TO_RENAME:
case Status.TYPE_CHANGED:
return { original: toGitUri(resource.original, 'HEAD') };
case Status.MODIFIED:
case Status.UNTRACKED:
return { original: toGitUri(resource.resourceUri, '~') };
case Status.DELETED_BY_US: