Start git without a console window on Windows, and run one reload at a time
ci / check (push) Successful in 2m27s
release / release (push) Successful in 11m52s

This commit was merged in pull request #3.
This commit is contained in:
2026-10-15 12:14:01 +02:00
parent e6c70554f3
commit 394d92e756
2 changed files with 18 additions and 6 deletions
+11 -6
View File
@@ -32,12 +32,17 @@ pub struct RepoData {
}
pub fn git(dir: &Path, args: &[&str]) -> Result<String, String> {
let out = Command::new("git")
.arg("-C")
.arg(dir)
.args(args)
.output()
.map_err(|e| format!("could not run git: {e}"))?;
let mut cmd = Command::new("git");
cmd.arg("-C").arg(dir).args(args);
// gites has no console, so Windows would open a console window for every git it
// starts. Each one flashes on screen and takes the focus, and gites reloads on focus.
#[cfg(windows)]
{
use std::os::windows::process::CommandExt;
const CREATE_NO_WINDOW: u32 = 0x0800_0000;
cmd.creation_flags(CREATE_NO_WINDOW);
}
let out = cmd.output().map_err(|e| format!("could not run git: {e}"))?;
if !out.status.success() {
return Err(String::from_utf8_lossy(&out.stderr).trim().to_string());
}
+7
View File
@@ -105,11 +105,18 @@ function startDrag(e: PointerEvent, axis: "x" | "y") {
let filtersLoadedFor: string | null = null;
let loading = false;
async function load() {
// The window gets focus often; one reload at a time is enough.
if (loading) return;
loading = true;
try {
await applyRepo(await invoke<RepoData>("load_repo"));
} catch (e) {
error.value = String(e);
} finally {
loading = false;
}
}