sketch/loop: fuss more with /git/cat and 204s
For unknown reasons, switching to 204s made the diff view noticeably slower.
Be more explicit about things in the hope that it helps.
Co-Authored-By: sketch <hello@sketch.dev>
Change-ID: s52c5ab6557e1f9dbk
diff --git a/webui/src/web-components/git-data-service.ts b/webui/src/web-components/git-data-service.ts
index b3aec25..6ff89af 100644
--- a/webui/src/web-components/git-data-service.ts
+++ b/webui/src/web-components/git-data-service.ts
@@ -166,6 +166,9 @@
`Failed to fetch working copy content (${response.status}): ${errorText}`,
);
}
+ if (response.status === 204) {
+ return ""; // file doesn't exist
+ }
const data = await response.json();
return data.output || "";