{"record":{"id":"17e52914e6436e7c","repo":"gitbutlerapp/gitbutler","slug":"land-cancelled","errorCode":null,"errorMessage":"Land cancelled","messagePattern":"Land cancelled","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"info","filePath":"crates/but/src/command/legacy/land/messaging.rs","lineNumber":242,"sourceCode":"    }\n\n    if yes {\n        return Ok(());\n    }\n\n    let Some(mut inout) = out.prepare_for_terminal_input() else {\n        bail!(\n            \"Refusing to directly update {target_display} without confirmation. Re-run with --yes to confirm.\"\n        );\n    };\n\n    let question = if extras.is_empty() {\n        format!(\"Land {branch_name} directly onto {target_display}?\")\n    } else {\n        format!(\"Land {branch_name} and everything below it directly onto {target_display}?\")\n    };\n    if inout.confirm(question, ConfirmDefault::No)? == Confirm::No {\n        bail!(\"Land cancelled\");\n    }\n\n    Ok(())\n}\n\n/// The open pull-request numbers attached to `branch_name` or any of `lower_segments`. Landing\n/// deletes each landed branch's remote copy, which closes the attached reviews on the forge, so\n/// all are surfaced.\n///\n/// Only applied workspace segments can land, so this reads the forge review associations that\n/// `head_info` projects onto the workspace segments (`segment.metadata.review.pull_request` is\n/// overwritten from the forge review cache there, not stored state) instead of computing the\n/// repository-wide branch listing.\npub(super) fn attached_pr_numbers(\n    ctx: &Context,\n    branch_name: &str,\n    lower_segments: &[String],\n) -> anyhow::Result<Vec<(String, usize)>> {","sourceCodeStart":224,"sourceCodeEnd":260,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/caf1f223d3cfb94488c9198ad34487c6006c648f/crates/but/src/command/legacy/land/messaging.rs#L224-L260","documentation":"The interactive confirmation for landing directly onto the target branch ('Land X directly onto Y?') defaults to No (`ConfirmDefault::No`). Answering 'n' — or just pressing Enter — makes the CLI bail with 'Land cancelled'. Nothing was modified; this is a clean, user-initiated abort.","triggerScenarios":"Answering No (or bare Enter, since the default is No) at the 'Land <branch> directly onto <target>?' prompt produced by land/messaging.rs:242.","commonSituations":"Declining after actually reading the direct-update warning; Enter-key habit carried over from prompts that default to Yes; cancelling after spotting the wrong branch or target in the question.","solutions":["Re-run `but land <branch>` and answer Yes, or pass `--yes` to skip the prompt.","Before confirming, double-check the branch and target named in the prompt against `but status`.","If the prompt names the wrong branch, you passed the wrong ID: re-resolve it from `but status`."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"# Distinguish a deliberate cancel from a real failure by exit status + message\nif ! but land \"$branch\" 2>err.txt; then\n  if grep -q 'Land cancelled' err.txt; then\n    echo 'land skipped by user'\n  else\n    cat err.txt; exit 1\n  fi\nfi","preventionTips":["Use `--yes` in automation where cancellation should not interrupt the pipeline.","Treat an exit with 'Land cancelled' as a no-op success in scripts."],"tags":["cli","land","user-cancelled","gitbutler"],"backgroundTag":"user-cancelled-operation","analyzedSha":"caf1f223d3cfb94488c9198ad34487c6006c648f","analyzedAt":"2026-08-20T07:55:40.983Z","schemaVersion":2},"datasetVersion":"2026-08-23T16:17:53.355Z"}