diff --git a/doc/fugitive.txt b/doc/fugitive.txt index f40afcf..f4392e2 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -34,6 +34,7 @@ that are part of Git repositories). window. The following maps, which work on the cursor line file where sensible, are provided: + this help next file previous file |:Gedit| diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 0d5ce4e..b20cbda 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -322,6 +322,8 @@ function! s:repo_head(...) dict abort " truncate hash to a:1 characters if we're in detached head mode let len = a:0 ? a:1 : 0 let branch = len ? head[0:len-1] : '' + else + return '' endif return branch @@ -2132,6 +2134,7 @@ function! s:BufReadIndex() abort xnoremap p :execute StagePatch(line("'<"),line("'>")) nnoremap q :if bufnr('$') == 1quitelsebdeleteendif nnoremap R :edit + nnoremap :help fugitive-:Gstatus catch /^fugitive:/ return 'echoerr v:errmsg' endtry @@ -2524,6 +2527,9 @@ endfunction " Statusline {{{1 function! s:repo_head_ref() dict abort + if !filereadable(self.dir('HEAD')) + return '' + endif return readfile(self.dir('HEAD'))[0] endfunction