fix: getHead returns default Branch(main) for empty repos git-remote-cospan calls getHead before the initial push to determine the default branch. Returning 404 on non-existent vcs stores prevented any initial push from succeeding. Return HeadState::Branch("main") as the empty-repo default so clients can proceed with push.

Author: Aaron Steven White
Commit bba19e855a302f7c46a55a56671ea227cfa7adbb
Parent: ea7e3c3430
Structural diff unavailable

These commits were pushed via plain git push, so no pre-parsed schemas are available. Install git-remote-cospan and re-push via panproto:// to see scope-level changes, breaking change detection, and semantic diffs.

brew install panproto/tap/git-remote-cospan
1 file changed +6 -4
@@ -18,12 +18,14 @@ pub async fn get_head(
1818     Query(params): Query<GetHeadParams>,
1919 ) -> Result<Json<serde_json::Value>, NodeError> {
2020     let store = state.store.lock().await;
21+
22+    // Return an empty-repo default (Branch("main")) when the vcs store
23+    // doesn't exist yet. git-remote-cospan calls getHead before the first
24+    // push to determine the default branch; returning 404 would prevent
25+    // any initial push from ever succeeding.
2126     let head = store
2227         .get_head(&params.did, &params.repo)
23-        .map_err(|_| NodeError::RepoNotFound {
24-            did: params.did.clone(),
25-            name: params.repo.clone(),
26-        })?;
28+        .unwrap_or_else(|_| panproto_core::vcs::HeadState::Branch("main".to_string()));
2729 
2830     // Flat format matches panproto-xrpc NodeClient expectations.
2931     let head_json = match head {
cospan · schematic version control on atproto built on AT Protocol