commit cfa7bdc82a2138b99fe3703765b52ad62f6149f0 (tree)
parent ddd64fc4c5c5365d56478f100f19898375244890
Author: Tim Pope <code@tpope.net>
Date: Mon, 6 Jan 2020 13:33:49 -0500
Handle packed refs in :Gbrowse
Closes https://github.com/tpope/vim-fugitive/issues/1428
Diffstat:
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim
@@ -5710,7 +5710,12 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, args) abo
endif
let i = 0
while commit =~# '^ref: ' && i < 10
- let commit = readfile(cdir . '/' . commit[5:-1], '', 1)[0]
+ let ref_file = cdir . '/' . commit[5:-1]
+ if getfsize(ref_file) > 0
+ let commit = readfile(ref_file, '', 1)[0]
+ else
+ let commit = fugitive#RevParse(ref_file, dir)
+ endif
let i -= 1
endwhile
endif