{"record":{"id":"4168d2934bb36c21","repo":"nikivdev/code","slug":"current-upstream-looks-ephemeral-and-no-origin","errorCode":null,"errorMessage":"Current upstream {} looks ephemeral and no origin/pr/* candidate was found. Set upstream explicitly to your PR branch, or re-run with --force.","messagePattern":"Current upstream (.+?) looks ephemeral and no origin/pr/\\* candidate was found\\. Set upstream explicitly to your PR branch, or re-run with --force\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/commit.rs","lineNumber":8040,"sourceCode":"fn ensure_safe_upstream_for_commit_queue_push(\n    repo_root: &Path,\n    head_sha: &str,\n    force: bool,\n) -> Result<()> {\n    let upstream = current_upstream_ref(repo_root);\n\n    if let Some(upstream) = upstream {\n        if is_ephemeral_upstream_ref(&upstream) && !force {\n            if let Some(candidate) = find_best_pr_upstream_candidate(repo_root, head_sha) {\n                if candidate != upstream {\n                    println!(\n                        \"Upstream {} looks ephemeral. Retargeting push upstream to {}.\",\n                        upstream, candidate\n                    );\n                    git_run_in(repo_root, &[\"branch\", \"--set-upstream-to\", &candidate])?;\n                }\n            } else {\n                bail!(\n                    \"Current upstream {} looks ephemeral and no origin/pr/* candidate was found. Set upstream explicitly to your PR branch, or re-run with --force.\",\n                    upstream\n                );\n            }\n        }\n        return Ok(());\n    }\n\n    if force {\n        return Ok(());\n    }\n\n    if let Some(candidate) = find_best_pr_upstream_candidate(repo_root, head_sha) {\n        println!(\n            \"No upstream configured. Using {} as push upstream.\",\n            candidate\n        );\n        git_run_in(repo_root, &[\"branch\", \"--set-upstream-to\", &candidate])?;","sourceCodeStart":8022,"sourceCodeEnd":8058,"githubUrl":"https://github.com/nikivdev/code/blob/a747e741ae92c09071d0ae946ab48488adcff1ce/src/commit.rs#L8022-L8058","documentation":"Error \"Current upstream {} looks ephemeral and no origin/pr/* candidate was found. Set upstream explicitly to your PR branch, or re-run with --force.\" thrown in nikivdev/code.","triggerScenarios":"Thrown at src/commit.rs:8040 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":"a747e741ae92c09071d0ae946ab48488adcff1ce","analyzedAt":"2026-09-01T22:43:55.719Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}