From cfa7bdc82a2138b99fe3703765b52ad62f6149f0 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Mon, 6 Jan 2020 13:33:49 -0500 Subject: [PATCH] Handle packed refs in :Gbrowse Closes https://github.com/tpope/vim-fugitive/issues/1428 --- autoload/fugitive.vim | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 2f102b5..61990b6 100644 --- 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