Skip to content

Commit Composer (Preview) fails on commits containing binary files: "cannot apply binary patch without full index line" #5405

Description

@nshepperd

Description

Recomposing any commit that contains a binary file (added or modified) fails when committing. This happens in every recompose entry point that uses the Commit Composer (Preview) webview: commit graph "Recompose Commits From Here (Preview)", interactive-rebase "Recompose" button and I assume also the compose commits button on the left gitlens extension panel. However the commit graph Recompose Branch option does work.

Steps to reproduce

# Create a repo with a single commit that adds a binary file:
mkdir gitlens-binary-recompose-bug && cd gitlens-binary-recompose-bug
git init -b main
git commit --allow-empty -m "root"

# any file git treats as binary works — an image, a zip, etc.
printf '\x89PNG\r\n\x1a\n\x00\x01\x02\x03 binary content here' > logo.png
git add logo.png
git commit -m "Add logo.png"

code .
# Open the Commit Graph (or the Commits view).
# Right-click the "Add logo.png" commit → "Recompose Commits From Here (Preview)".
# Recompose commits -> Create 1 Commit

The commit fails with this message:

Failed to commit changes: error: cannot apply binary patch to 'logo.png' without full index line error: logo.png: patch does not apply

GitLens Version

18.2.0

VS Code Version

Version: 1.123.0
Commit: 6a44c352bd24569c417e530095901b649960f9f8
Date: 2026-06-03T11:29:03+02:00
Electron: 42.2.0
ElectronBuildId: 14159160
Chromium: 148.0.7778.97
Node.js: 24.15.0
V8: 14.8.178.14-electron.0
OS: Linux x64 7.0.12-arch1-1

Git Version

git version 2.54.0

Logs, Screenshots, Screen Captures, etc

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageNeeds to be looked at

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions