astextplain: restore passthrough for plaintext DOC/DOT files#626
Merged
dscho merged 1 commit intogit-for-windows:mainfrom Jun 23, 2025
Merged
astextplain: restore passthrough for plaintext DOC/DOT files#626dscho merged 1 commit intogit-for-windows:mainfrom
dscho merged 1 commit intogit-for-windows:mainfrom
Conversation
The fix for git-for-windows/git#5641 broke diffs for plaintext DOC and DOT files: $ echo Test > test.doc $ git add test.doc $ git diff --cached E: unsupported filetype test.doc Since `file` correctly identifies the mimetype of such files as `text/plain`, this can be fixed by simply covering this case and printing the file content as it was done previously. Signed-off-by: Claudio Hoffmann <c.hoffmann@dev-threads.de>
Member
|
Thank you for the contribution! The checksums were incorrect, though, and unfortunately I lack the permission to fix it in this PR, therefore I opened #628. |
rimrul
added a commit
to rimrul/build-extra
that referenced
this pull request
Jan 8, 2026
Our astextplain helper used to pass through empty files and plaintext with the an expected extension. WHen we changed it to work based on mimetype rather than a predefined list of extensions in git-for-windows#624, both those passthroughs got lost. Plaintext passthrough has been restored in git-for-windows#626, but passthrough of empty files is still missing. Restore this functionality. This fixes git-for-windows/git#5977 Signed-off-by: Matthias Aßhauer <mha1993@live.de>
rimrul
added a commit
to rimrul/build-extra
that referenced
this pull request
Jan 8, 2026
Our astextplain helper used to pass through empty files and plaintext with the an expected extension. WHen we changed it to work based on mimetype rather than a predefined list of extensions in git-for-windows#624, both those passthroughs got lost. Plaintext passthrough has been restored in git-for-windows#626, but passthrough of empty files is still missing. Restore this functionality. This fixes git-for-windows/git#5977 Signed-off-by: Matthias Aßhauer <mha1993@live.de>
dscho
added a commit
that referenced
this pull request
Jan 9, 2026
Our `astextplain` helper used to pass through empty files and plaintext with the an expected extension. When we changed it to work based on mimetype rather than a predefined list of extensions in #624, both those passthroughs got lost. Plaintext passthrough has been restored in #626, but passthrough of empty files is still missing. Restore this functionality. This fixes git-for-windows/git#5977
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The fix for git-for-windows/git#5641 broke diffs for plaintext DOC and DOT files:
Since
filecorrectly identifies the mimetype of such files astext/plain, this can be fixed by simply covering this case and printing the file content as it was done previously.