{"record":{"id":"52c5fa93df134fa0","repo":"gitbutlerapp/gitbutler","slug":"target-ref-name-resolved-from-target-ref-is-not-a-remote","errorCode":null,"errorMessage":"Target ref '{name}' resolved from '{target_ref}' is not a remote-tracking branch","messagePattern":"Target ref '(.+?)' resolved from '(.+?)' is not a remote-tracking branch","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-debug/src/command/revision.rs","lineNumber":160,"sourceCode":"        );\n    };\n    writeln!(out, \"{merge_base}\")?;\n\n    Ok(())\n}\n\nfn args_to_tips(repo: &gix::Repository, graph_args: &RevisionGraphArgs) -> Result<Vec<Tip>> {\n    let mut tips = Vec::new();\n\n    if let Some(tip) = graph_args\n        .target_ref\n        .as_deref()\n        .map(|target_ref| {\n            let mut reference = repo\n                .find_reference(target_ref)\n                .with_context(|| format!(\"Failed to find target ref '{target_ref}'\"))?;\n            let name = reference.name().to_owned();\n            ensure!(\n                name.category() == Some(Category::RemoteBranch),\n                \"Target ref '{name}' resolved from '{target_ref}' is not a remote-tracking branch\"\n            );\n            let id = reference.peel_to_id()?.detach();\n            Ok(Tip::integrated(id, Some(name)))\n        })\n        .transpose()?\n    {\n        tips.push(tip);\n    }\n\n    Ok(tips)\n}\n\nfn graph_for_revisions(\n    repo: &gix::Repository,\n    meta: &EmptyRefMetadata,\n    commits: &[gix::ObjectId],","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-debug/src/command/revision.rs#L142-L178","documentation":"Thrown by `args_to_tips` in but-debug's revision command handling when the `--target` ref string resolves (via `find_reference`) to a reference whose fully-qualified name is not in the `Category::RemoteBranch` category (e.g. `refs/heads/...` or `refs/tags/...`). The command only accepts remote-tracking branches such as `refs/remotes/origin/main` as integration targets, so any other ref kind is rejected with this message.","triggerScenarios":"Running a but-debug revision subcommand (log or merge_base path) with a target-ref argument that names a local branch, tag, HEAD, or other non-remote-tracking ref, e.g. `--target main` resolving to `refs/heads/main`.","commonSituations":"Passing a local branch name instead of its remote-tracking counterpart; using a tag as the merge target; a repo where the branch has no remote counterpart; typos or shorthand refs that gix resolves to a non-remote category.","solutions":["Use the remote-tracking form of the ref, e.g. `origin/main` instead of `main`.","Fetch first (`git fetch origin`) so the remote-tracking branch exists, then retry.","Verify the resolved ref category with `git rev-parse --symbolic-full-name <ref>`; it must start with refs/remotes/.","If the target should legitimately be a local ref, the calling command/flag needs extending rather than the input changing."],"exampleFix":"// before\nbut-debug revision log --target main\n// after\nbut-debug revision log --target origin/main","handlingStrategy":"validation","validationCode":"async function ensureRemoteTrackingBranch(ref) {\n  const full = await git.revParse(['--symbolic-full-name', ref]);\n  if (!full.startsWith('refs/remotes/')) {\n    throw new Error(`${ref} resolves to ${full}; pass a remote-tracking branch like origin/main`);\n  }\n  return full;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always pass remote-tracking refs (origin/...) to revision commands targeting integration points.","Fetch before invoking so remote-tracking branches are up to date.","Check symbolic full names of refs in scripts before passing them as targets."],"tags":["git","refs","cli","invalid-argument-value"],"backgroundTag":"incompatible-source-type","analyzedSha":"58e5313667b857ef39a730e380af31816a7b1768","analyzedAt":"2026-09-18T06:50:32.052Z","contentChangedAt":"2026-09-18T06:50:32.052Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}