{"record":{"id":"3b938e844ecf4341","repo":"GitoxideLabs/gitoxide","slug":"could-not-follow-all-splits-after-round-rounds","errorCode":null,"errorMessage":"Could not follow all splits after {round} rounds, assuming reference cycle","messagePattern":"Could not follow all splits after (.+?) rounds, assuming reference cycle","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"gix-ref/src/transaction/ext.rs","lineNumber":107,"sourceCode":"                                    log,\n                                    LogChange {\n                                        message: log.message.clone(),\n                                        mode: RefLog::Only,\n                                        force_create_reflog: log.force_create_reflog,\n                                    },\n                                );\n                                let next = std::mem::replace(expected, PreviousValue::Any);\n                                RefEdit::update_with_log(referent, new.clone(), next, current).with_deref(true)\n                            }\n                        },\n                    ));\n                }\n            }\n            if new_edits.is_empty() {\n                break Ok(());\n            }\n            if round == 5 {\n                break Err(std::io::Error::new(\n                    std::io::ErrorKind::WouldBlock,\n                    format!(\"Could not follow all splits after {round} rounds, assuming reference cycle\"),\n                ));\n            }\n            round += 1;\n            first = self.len();\n\n            self.append(&mut new_edits);\n        }\n    }\n}\n","sourceCodeStart":89,"sourceCodeEnd":119,"githubUrl":"https://github.com/GitoxideLabs/gitoxide/blob/e73179060badf27222d790981fac3f84c1830a7e/gix-ref/src/transaction/ext.rs#L89-L119","documentation":"When extending a reference transaction through splits of symbolic refs (resolving symref chains into concrete ref edits), the algorithm loops up to 5 rounds; if edits remain after round 5 it gives up with WouldBlock: 'Could not follow all splits after {round} rounds, assuming reference cycle'. It indicates symbolic references form a cycle (e.g. HEAD -> a -> b -> a), so no consistent edit set can be derived.","triggerScenarios":"`Transaction::pre_process` calling `extend_with_splits_of_symbolic_refs` on a repository whose symbolic references form a loop longer than 5 resolution rounds, or whose `find` callback keeps returning further symref targets.","commonSituations":"Manually edited or corrupted symbolic refs in .git/; crafted repositories with ref-to-ref cycles; scripts that create symref chains by accident.","solutions":["Inspect and fix the symbolic refs (`git symbolic-ref` on the chain) to break the cycle","Delete or rewrite the offending symref files in .git/ manually if tooling can't","Validate the repository with `git fsck` and repair or re-clone","Ensure custom `find` implementations terminate and return real targets, not looping ones"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// detect symref cycles before transacting\nfn resolve(head: &gix_ref::Reference, find: impl Fn(&[u8]) -> Option<gix_ref::Reference>) -> usize {\n    let mut seen = std::collections::HashSet::new();\n    let mut cur = head.clone();\n    while let Some(t) = cur.target().try_into().ok().and_then(|n| find(n.as_ref())) {\n        if !seen.insert(t.name().as_bstr().to_vec()) { return seen.len(); /* cycle */ }\n        cur = t;\n    }\n    seen.len()\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Audit symbolic refs for cycles before transactions (`git symbolic-ref -d` to break loops)","Avoid manually editing .git symref files","Run `git fsck` on repositories with hand-crafted refs"],"tags":["ref","symbolic-ref","cycle","git"],"backgroundTag":"invalid-state-transition","analyzedSha":"e73179060badf27222d790981fac3f84c1830a7e","analyzedAt":"2026-09-08T11:26:50.865Z","contentChangedAt":"2026-09-08T11:26:50.865Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}