{"record":{"id":"d979c6ae26a94350","repo":"zed-industries/zed","slug":"origin-main-tip-main-sha-12-unavailable-locall","errorCode":null,"errorMessage":"origin/main tip {main_sha[:12]} unavailable locally after fetch","messagePattern":"origin/main tip (.+?) unavailable locally after fetch","errorType":"exception","errorClass":"RuntimeError","httpStatus":null,"severity":"error","filePath":"crates/eval_cli/zed_eval/source.py","lineNumber":107,"sourceCode":"def base_sha_on_main(base_sha: str, repo_url: str) -> bool:\n    \"\"\"Whether `base_sha` is reachable from origin/main.\n\n    Resolves origin/main's tip against the remote (so it doesn't depend on the\n    caller's possibly-stale local refs), fetching main if the objects aren't\n    present locally, then checks ancestry. Raises only when the main tip can't be\n    made available locally (a network/remote problem), so callers can\n    distinguish that from a definitive \"not on main\".\n    \"\"\"\n    main_sha = resolve_remote_ref(repo_url, \"main\")\n    if base_sha.lower() == main_sha.lower():\n        return True\n    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:","sourceCodeStart":89,"sourceCodeEnd":125,"githubUrl":"https://github.com/zed-industries/zed/blob/bc538def4545534201bbfcac4e95ac34ea6501b6/crates/eval_cli/zed_eval/source.py#L89-L125","documentation":"Error \"origin/main tip {main_sha[:12]} unavailable locally after fetch\" thrown in zed-industries/zed.","triggerScenarios":"Thrown at crates/eval_cli/zed_eval/source.py:107 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"}