From 96382f279f290c8a570ed25c4f70bd2b9f08d1e1 Mon Sep 17 00:00:00 2001 From: Mattias Granlund Date: Thu, 2 Jan 2025 19:46:48 +0100 Subject: [PATCH] Create re-usable file service for reading git blobs - decouples reading from workspace from reading from commit --- apps/desktop/src/lib/file/FileDiff.svelte | 30 +++---- apps/desktop/src/lib/files/file.ts | 6 ++ apps/desktop/src/lib/files/fileService.ts | 33 ++++++++ apps/desktop/src/routes/+layout.ts | 9 +- .../src/routes/[projectId]/+layout.svelte | 2 + crates/gitbutler-repo/src/commands.rs | 84 +++++++++---------- crates/gitbutler-tauri/src/forge.rs | 2 +- crates/gitbutler-tauri/src/main.rs | 3 +- crates/gitbutler-tauri/src/repo.rs | 21 +++-- 9 files changed, 115 insertions(+), 75 deletions(-) create mode 100644 apps/desktop/src/lib/files/file.ts create mode 100644 apps/desktop/src/lib/files/fileService.ts diff --git a/apps/desktop/src/lib/file/FileDiff.svelte b/apps/desktop/src/lib/file/FileDiff.svelte index d8a412bd80..6df1de8be7 100644 --- a/apps/desktop/src/lib/file/FileDiff.svelte +++ b/apps/desktop/src/lib/file/FileDiff.svelte @@ -1,6 +1,6 @@