From 769f31bb9b5587eb5ae0ac1d7832ea378229d30b Mon Sep 17 00:00:00 2001 From: Claudio Hoffmann Date: Sat, 21 Jun 2025 21:35:25 +0200 Subject: [PATCH] astextplain: restore passthrough for plaintext DOC/DOT files The fix for https://github.com/git-for-windows/git/issues/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 --- git-extra/astextplain | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/git-extra/astextplain b/git-extra/astextplain index ac5ab42390..ca1eb88a28 100755 --- a/git-extra/astextplain +++ b/git-extra/astextplain @@ -21,7 +21,7 @@ case "$(file --brief --mime-type "$1")" in out=$(pdftotext -q -layout -enc UTF-8 "$1" -) && sed "s/(\^M$)|(^\^L)//" <<<$out || cat "$1" ;; # TODO add rtf support - application/rtf | text/rtf) + application/rtf | text/rtf | text/plain) cat "$1" ;; *)