From 503c22f1f54c9f19e18b60f6d24e76d3100844f0 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 13 Apr 2021 07:50:13 -0400 Subject: [PATCH] Fix status in bare repository --- autoload/fugitive.vim | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 2afc417..bac9c1b 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -1853,7 +1853,11 @@ function! fugitive#BufReadStatus() abort let [staged, unstaged, untracked] = [[], [], []] let props = {} - if fugitive#GitVersion(2, 11) + let pull = '' + if empty(s:Tree()) + let branch = FugitiveHead(0) + let head = FugitiveHead(11) + elseif fugitive#GitVersion(2, 11) let cmd += ['status', '--porcelain=v2', '-bz'] let [output, message, exec_error] = s:NullError(cmd) if exec_error @@ -1912,7 +1916,6 @@ function! fugitive#BufReadStatus() abort call remove(output, 0) endwhile let head = matchstr(output[0], '^## \zs\S\+\ze\%($\| \[\)') - let pull = '' if head =~# '\.\.\.' let [head, pull] = split(head, '\.\.\.') let branch = head @@ -1947,10 +1950,6 @@ function! fugitive#BufReadStatus() abort endwhile endif - if empty(s:Tree()) - let [unstaged, untracked] = [[], []] - endif - for dict in staged let b:fugitive_files['Staged'][dict.filename] = dict endfor