From 4ec072df23281eb82600914e8dfc0b6c7694763f Mon Sep 17 00:00:00 2001 From: Andy Stewart Date: Fri, 2 Jun 2023 09:59:24 +0100 Subject: [PATCH] Enable text conversion in git-show This tells git-show to output the smudged version of a file if a clean/smudge filter is defined for it. In turns this allows us to diff the buffer contents (which is smudged) against the reference version. However patches cannot be applied. See the man pages for git-show and gitattributes for more information. See #796, #435. --- autoload/gitgutter/diff.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/gitgutter/diff.vim b/autoload/gitgutter/diff.vim index eb41312..220dd29 100644 --- a/autoload/gitgutter/diff.vim +++ b/autoload/gitgutter/diff.vim @@ -138,7 +138,7 @@ function! gitgutter#diff#run_diff(bufnr, from, preserve_full_diff) abort " Write file from index to temporary file. let index_name = gitgutter#utility#get_diff_base(a:bufnr).':'.gitgutter#utility#repo_path(a:bufnr, 1) - let cmd .= g:gitgutter_git_executable.' '.g:gitgutter_git_args.' --no-pager show '.index_name.' > '.from_file.' && ' + let cmd .= g:gitgutter_git_executable.' '.g:gitgutter_git_args.' --no-pager show --textconv '.index_name.' > '.from_file.' && ' elseif a:from ==# 'working_tree' let from_file = gitgutter#utility#repo_path(a:bufnr, 1)