diff --git a/autoload/fugitive.vim b/autoload/fugitive.vim index 9b6363ec1a..6fdd80e07e 100644 --- a/autoload/fugitive.vim +++ b/autoload/fugitive.vim @@ -7561,8 +7561,9 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, ...) abor endif endif endif + let commit_id = fugitive#RevParse(empty(ref) ? 'HEAD' : ref, dir) if empty(commit) - let commit = fugitive#RevParse(empty(ref) ? 'HEAD' : ref, dir) + let commit = commit_id endif endif @@ -7579,6 +7580,8 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, ...) abor \ 'repo': {'git_dir': git_dir}, \ 'remote': raw, \ 'remote_name': remote, + \ 'starting_ref': empty(ref) ? 'HEAD' : ref, + \ 'commit_id': exists('commit_id') ? commit_id : commit, \ 'commit': s:UrlEncode(commit), \ 'path': substitute(s:UrlEncode(path), '%20', ' ', 'g'), \ 'type': type,