{"record":{"id":"5da981b606bbfa33","repo":"zed-industries/zed","slug":"git-merge-base-is-ancestor-failed","errorCode":null,"errorMessage":"git merge-base --is-ancestor failed","messagePattern":"git merge-base --is-ancestor failed","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"crates/eval_cli/zed_eval/source.py","lineNumber":119,"sourceCode":"    if not (commit_present(base_sha) and commit_present(main_sha)):\n        subprocess.run(\n            [\"git\", \"-C\", repo_root(), \"fetch\", \"--quiet\", repo_url, \"main\"],\n            capture_output=True,\n        )\n    if not commit_present(main_sha):\n        raise RuntimeError(\n            f\"origin/main tip {main_sha[:12]} unavailable locally after fetch\"\n        )\n    if not commit_present(base_sha):\n        # Not present even after pulling main's history -> not reachable from main.\n        return False\n    ancestry = subprocess.run(\n        [\"git\", \"-C\", repo_root(), \"merge-base\", \"--is-ancestor\", base_sha, main_sha],\n        capture_output=True,\n    )\n    if ancestry.returncode in (0, 1):\n        return ancestry.returncode == 0\n    raise RuntimeError(\n        (ancestry.stderr or b\"\").decode(errors=\"replace\").strip()\n        or \"git merge-base --is-ancestor failed\"\n    )\n\n\ndef resolve_git_ref(ref: str) -> str:\n    return git_output([\"rev-parse\", \"--verify\", f\"{ref}^{{commit}}\"])\n\n\n_FULL_SHA_RE = re.compile(r\"[0-9a-fA-F]{40}\")\n\n\ndef resolve_remote_ref(repo_url: str, ref: str) -> str:\n    \"\"\"Resolve a git ref/tag/branch/SHA to a canonical commit SHA against the\n    *remote* repo, so the resulting build id is identical for every launcher\n    regardless of what they happen to have fetched locally.\n\n    A full 40-char SHA is already canonical and is returned (lowercased) without","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/eval_cli/zed_eval/source.py#L101-L137","documentation":"Error \"git merge-base --is-ancestor failed\" thrown in zed-industries/zed.","triggerScenarios":"Thrown at crates/eval_cli/zed_eval/source.py:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bc538def4545534201bbfcac4e95ac34ea6501b6","analyzedAt":"2026-08-16T07:30:46.435Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}