From 4adf054a3f6f6ecad303e3e90c169cdf37f6c0e9 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sun, 8 Aug 2021 22:42:33 -0400 Subject: [PATCH] Fix fugitive#writefile() when staging new file --- autoload/fugitive.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 3997148..54ba44e 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1753,7 +1753,7 @@ function! fugitive#writefile(lines, url, ...) abort endif call call('writefile', [a:lines, temp] + a:000) 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,\}$' let error = s:UpdateIndex(dir, [mode, hash, commit, file[1:-1]]) if empty(error)