mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-08 11:33:47 -05:00
Fix fugitive#writefile() when staging new file
This commit is contained in:
@@ -1753,7 +1753,7 @@ function! fugitive#writefile(lines, url, ...) abort
|
|||||||
endif
|
endif
|
||||||
call call('writefile', [a:lines, temp] + a:000)
|
call call('writefile', [a:lines, temp] + a:000)
|
||||||
let hash = s:ChompDefault('', [dir, '--literal-pathspecs', 'hash-object', '-w', FugitiveGitPath(temp)])
|
let hash = s:ChompDefault('', [dir, '--literal-pathspecs', 'hash-object', '-w', FugitiveGitPath(temp)])
|
||||||
let mode = len(entry[1]) ? entry[1] : '100644'
|
let mode = entry[1] !=# '000000' ? 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]])
|
||||||
if empty(error)
|
if empty(error)
|
||||||
|
|||||||
Reference in New Issue
Block a user