mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 06:43:51 -05:00
Fix :GBrowse :/ in bare repositories
This commit is contained in:
@@ -6164,7 +6164,7 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo
|
|||||||
let expanded = '.git/refs/' . subdir . expanded
|
let expanded = '.git/refs/' . subdir . expanded
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
let full = fugitive#Find(expanded, dir)
|
let full = s:Generate(expanded, dir)
|
||||||
let commit = ''
|
let commit = ''
|
||||||
if full =~? '^fugitive:'
|
if full =~? '^fugitive:'
|
||||||
let [dir, commit, path] = s:DirCommitFile(full)
|
let [dir, commit, path] = s:DirCommitFile(full)
|
||||||
@@ -6174,6 +6174,8 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo
|
|||||||
if commit =~ '..'
|
if commit =~ '..'
|
||||||
let type = s:TreeChomp(['cat-file','-t',commit.s:sub(path,'^/',':')], dir)
|
let type = s:TreeChomp(['cat-file','-t',commit.s:sub(path,'^/',':')], dir)
|
||||||
let branch = matchstr(expanded, '^[^:]*')
|
let branch = matchstr(expanded, '^[^:]*')
|
||||||
|
elseif empty(path) || path ==# '/'
|
||||||
|
let type = 'tree'
|
||||||
else
|
else
|
||||||
let type = 'blob'
|
let type = 'blob'
|
||||||
endif
|
endif
|
||||||
|
|||||||
Reference in New Issue
Block a user