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.
This commit is contained in:
Andy Stewart
2023-06-02 09:59:24 +01:00
parent 11d6e13194
commit 4ec072df23

View File

@@ -138,7 +138,7 @@ function! gitgutter#diff#run_diff(bufnr, from, preserve_full_diff) abort
" Write file from index to temporary file. " 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 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' elseif a:from ==# 'working_tree'
let from_file = gitgutter#utility#repo_path(a:bufnr, 1) let from_file = gitgutter#utility#repo_path(a:bufnr, 1)