mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Use Git paths when passing temp files to hash-object
This commit is contained in:
@@ -1752,7 +1752,7 @@ function! fugitive#writefile(lines, url, ...) abort
|
|||||||
call writefile(fugitive#readfile(url, 'b'), temp, 'b')
|
call writefile(fugitive#readfile(url, 'b'), temp, 'b')
|
||||||
endif
|
endif
|
||||||
call call('writefile', [a:lines, temp] + a:000)
|
call call('writefile', [a:lines, temp] + a:000)
|
||||||
let hash = s:ChompDefault('', [dir, 'hash-object', '-w', temp])
|
let hash = s:ChompDefault('', [dir, '--literal-pathspecs', 'hash-object', '-w', FugitiveGitPath(temp)])
|
||||||
let mode = len(entry[1]) ? entry[1] : '100644'
|
let mode = len(entry[1]) ? entry[1] : '100644'
|
||||||
if hash =~# '^\x\{40,\}$'
|
if hash =~# '^\x\{40,\}$'
|
||||||
let error = s:UpdateIndex(dir, [mode, hash, commit, file[1:-1]])
|
let error = s:UpdateIndex(dir, [mode, hash, commit, file[1:-1]])
|
||||||
@@ -2426,7 +2426,7 @@ function! fugitive#FileWriteCmd(...) abort
|
|||||||
return "noautocmd '[,']write" . (v:cmdbang ? '!' : '') . ' ' . s:fnameescape(amatch)
|
return "noautocmd '[,']write" . (v:cmdbang ? '!' : '') . ' ' . s:fnameescape(amatch)
|
||||||
endif
|
endif
|
||||||
silent execute "noautocmd keepalt '[,']write ".temp
|
silent execute "noautocmd keepalt '[,']write ".temp
|
||||||
let hash = s:TreeChomp([dir, 'hash-object', '-w', '--', temp])
|
let hash = s:TreeChomp([dir, '--literal-pathspecs', 'hash-object', '-w', '--', FugitiveGitPath(temp)])
|
||||||
let old_mode = matchstr(s:ChompDefault('', ['ls-files', '--stage', '.' . file], dir), '^\d\+')
|
let old_mode = matchstr(s:ChompDefault('', ['ls-files', '--stage', '.' . file], dir), '^\d\+')
|
||||||
if empty(old_mode)
|
if empty(old_mode)
|
||||||
let old_mode = executable(s:Tree(dir) . file) ? '100755' : '100644'
|
let old_mode = executable(s:Tree(dir) . file) ? '100755' : '100644'
|
||||||
|
|||||||
Reference in New Issue
Block a user