From 1d00a7392bda3ed337358b867f8a102c8a78a55c Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Tue, 13 Apr 2021 09:04:38 -0400 Subject: [PATCH] Fix :GBrowse :/ in bare repositories --- autoload/fugitive.vim | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index a211b97..294c4bf 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -6164,7 +6164,7 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo let expanded = '.git/refs/' . subdir . expanded endif endfor - let full = fugitive#Find(expanded, dir) + let full = s:Generate(expanded, dir) let commit = '' if full =~? '^fugitive:' let [dir, commit, path] = s:DirCommitFile(full) @@ -6174,6 +6174,8 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo if commit =~ '..' let type = s:TreeChomp(['cat-file','-t',commit.s:sub(path,'^/',':')], dir) let branch = matchstr(expanded, '^[^:]*') + elseif empty(path) || path ==# '/' + let type = 'tree' else let type = 'blob' endif