diff --git a/crates/grove-daemon/src/purge.rs b/crates/grove-daemon/src/purge.rs index 573ffb5..c2028d1 100644 --- a/crates/grove-daemon/src/purge.rs +++ b/crates/grove-daemon/src/purge.rs @@ -22,6 +22,7 @@ pub fn looks_gone(fetch_error: &str) -> bool { "not found", "does not appear to be a git repository", "does not exist", + "cannot find repository", // Gitea/Forgejo over SSH "error: 404", ] .iter() @@ -183,6 +184,10 @@ mod tests { assert!(looks_gone( "fatal: 'x.git' does not appear to be a git repository" )); + assert!(looks_gone( + "git fetch -q --prune origin failed (Some(128)): error:\nerror: Cannot find \ + repository: dasemu/x\nerror:\nfatal: Could not read from remote repository." + )); assert!(!looks_gone( "ssh: connect to host h port 22: Connection timed out" )); diff --git a/docs/phase6.md b/docs/phase6.md index ae6cf23..918c8a4 100644 --- a/docs/phase6.md +++ b/docs/phase6.md @@ -127,7 +127,7 @@ A managed repo whose remote was deleted is moved out of the synced tree, never d purged_dir = "Purged" # default; "" disables the move ``` -- Trigger: a fetch fails with a "not found"-style error. That is only a hint: the forge serving +- Trigger: a fetch fails with a "not found"-style error (also Gitea's SSH "Cannot find repository"). That is only a hint: the forge serving `origin` must then answer 404 while the same token works (`test_connection`), and still do so `purge::CONFIRM_AFTER_SECS` (10 min) after the first confirmation (a gap of more than twice that starts over). A working fetch, or the forge seeing the repo again, clears it. Network or