From 9ce67cdc934fcccaa09209c61be0fe312a6290c7 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Sat, 26 Dec 2015 15:09:08 -0500 Subject: [PATCH] Always pass commit SHA to :Gbrowse handlers --- plugin/fugitive.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 0452956..86789c4 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -2215,6 +2215,9 @@ function! s:Browse(bang,line1,count,...) abort if type ==# 'tree' && !empty(path) let path = s:sub(path, '/\=$', '/') endif + if empty(commit) && path !~# '^\.git/' + let commit = s:repo().rev_parse('HEAD') + endif if path =~# '^\.git/.*HEAD' && filereadable(s:repo().dir(path[5:-1])) let body = readfile(s:repo().dir(path[5:-1]))[0] if body =~# '^\x\{40\}$'