From b9084edd1cf2414e21de4f9e5b5acae240a22218 Mon Sep 17 00:00:00 2001 From: Ladislau Szomoru <3372902+lszomoru@users.noreply.github.com> Date: Fri, 20 Dec 2024 10:08:22 +0100 Subject: [PATCH] Git - file system provider should throw `FileNotFound` if the resource does not exist in git instead of returning an empty file (#236676) --- extensions/git/src/fileSystemProvider.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/extensions/git/src/fileSystemProvider.ts b/extensions/git/src/fileSystemProvider.ts index af80924ae13..24ae4e6df9a 100644 --- a/extensions/git/src/fileSystemProvider.ts +++ b/extensions/git/src/fileSystemProvider.ts @@ -192,7 +192,8 @@ export class GitFileSystemProvider implements FileSystemProvider { try { return await repository.buffer(sanitizeRef(ref, path, repository), path); } catch (err) { - return new Uint8Array(0); + // File does not exist in git (ex: git ignored) + throw FileSystemError.FileNotFound(); } }