nikivdev/code · error

Current upstream {} looks ephemeral and no origin/pr/* candi

Error message

Current upstream {} looks ephemeral and no origin/pr/* candidate was found. Set upstream explicitly to your PR branch, or re-run with --force.

What it means

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.

Source

Thrown at src/commit.rs:8040

fn ensure_safe_upstream_for_commit_queue_push(
    repo_root: &Path,
    head_sha: &str,
    force: bool,
) -> Result<()> {
    let upstream = current_upstream_ref(repo_root);

    if let Some(upstream) = upstream {
        if is_ephemeral_upstream_ref(&upstream) && !force {
            if let Some(candidate) = find_best_pr_upstream_candidate(repo_root, head_sha) {
                if candidate != upstream {
                    println!(
                        "Upstream {} looks ephemeral. Retargeting push upstream to {}.",
                        upstream, candidate
                    );
                    git_run_in(repo_root, &["branch", "--set-upstream-to", &candidate])?;
                }
            } else {
                bail!(
                    "Current upstream {} looks ephemeral and no origin/pr/* candidate was found. Set upstream explicitly to your PR branch, or re-run with --force.",
                    upstream
                );
            }
        }
        return Ok(());
    }

    if force {
        return Ok(());
    }

    if let Some(candidate) = find_best_pr_upstream_candidate(repo_root, head_sha) {
        println!(
            "No upstream configured. Using {} as push upstream.",
            candidate
        );
        git_run_in(repo_root, &["branch", "--set-upstream-to", &candidate])?;

View on GitHub (pinned to a747e741ae)

When it happens

Trigger: Thrown at src/commit.rs:8040 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/4168d2934bb36c21. Report an issue: GitHub.