{"record":{"id":"ce8bbc4724eecbb9","repo":"gitbutlerapp/gitbutler","slug":"the-resolution-for-path-contains-a-conflict-ma","errorCode":null,"errorMessage":"The resolution for \"{path}\" contains a conflict marker ({marker:?})","messagePattern":"The resolution for \"(.+?)\" contains a conflict marker \\((.+?)\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/but-api/src/resolve/apply.rs","lineNumber":157,"sourceCode":"            .is_some()\n        {\n            bail!(\n                \"Two conflicted paths normalize to the same value ({:?}); resolve this commit manually instead\",\n                normalize_path(&file.path)\n            );\n        }\n    }\n    Ok(files_by_path)\n}\n\n/// Reject content that contains a conflict-marker-shaped line.\npub(crate) fn ensure_no_markers(content: &str, path: &str) -> anyhow::Result<()> {\n    if let Some(marker) = content\n        .lines()\n        .map(|line| line.strip_suffix('\\r').unwrap_or(line))\n        .find(|line| is_marker_shaped(line))\n    {\n        bail!(\"The resolution for \\\"{path}\\\" contains a conflict marker ({marker:?})\");\n    }\n    Ok(())\n}\n\n/// Normalize a path for comparison: trim, backslashes to slashes, strip a\n/// leading `./`, collapse duplicate slashes. Applied to both request and\n/// caller-provided paths, so callers matching against [`ConflictedFile`] paths\n/// should normalize with this too.\n///\n/// [`ConflictedFile`]: super::ConflictedFile\npub fn normalize_path(path: &str) -> String {\n    let mut normalized = path.trim().replace('\\\\', \"/\");\n    while normalized.contains(\"//\") {\n        normalized = normalized.replace(\"//\", \"/\");\n    }\n    normalized\n        .strip_prefix(\"./\")\n        .map(str::to_owned)","sourceCodeStart":139,"sourceCodeEnd":175,"githubUrl":"https://github.com/gitbutlerapp/gitbutler/blob/58e5313667b857ef39a730e380af31816a7b1768/crates/but-api/src/resolve/apply.rs#L139-L175","documentation":"The user-supplied resolution content still contains a git conflict marker line (e.g. <<<<<<<, =======, >>>>>>>, detected via is_marker_shaped). Committing such content would embed unresolved conflict markers, so the library rejects it upfront. Trailing \\r is stripped so CRLF files are still detected.","triggerScenarios":"ensure_no_markers (from validate_specs) finds a marker-shaped line in the content of a HunkResolution::Content (or full-file resolution) being applied.","commonSituations":"Pasting a resolution directly from an editor still showing markers, programmatically extracting hunk content that includes the surrounding marker lines, AI suggestions that copied marker text, or tools that only remove `<<<<<<<` but leave `=======`.","solutions":["Strip all conflict marker lines (<<<<<<<, =======, >>>>>>>, |||||||) from the resolution content","Edit the file manually to choose actual resolved content between markers","Improve the generating tool/AI prompt to exclude marker lines"],"exampleFix":"// before\ncontent: \"<<<<<<< HEAD\\nfoo\\n=======\\nbar\\n>>>>>>> branch\"\n// after\ncontent: \"bar\" // markers removed, one side chosen or merged","handlingStrategy":"validation","validationCode":"/^(<{7}|={7}|>{7}|\\|{7})/.test(content) && throw new Error('resolution still contains conflict markers');","typeGuard":null,"tryCatchPattern":"try { await applyResolution(content); } catch (e) { if (String(e).includes('contains a conflict marker')) { content = stripMarkers(content); await applyResolution(content); } else { throw e; } }","preventionTips":["Strip marker lines before submitting resolution content","Never copy content directly from a conflicted editor buffer","Add marker detection to any tool that generates resolutions"],"tags":["validation","conflict-markers","merge-conflict"],"backgroundTag":"schema-validation-failed","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"}