Simplify conditional around :GBrowse line number computation

This is solely to improve the readability of upcoming diffs.
This commit is contained in:
Tim Pope
2022-06-17 23:00:40 -04:00
parent bef885fd00
commit 763f42cab5

View File

@@ -7369,11 +7369,9 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, ...) abor
let line1 = a:count > 0 && type ==# 'blob' ? a:line1 : 0
let line2 = a:count > 0 && type ==# 'blob' ? a:count : 0
if empty(commit) && path !~# '^\.git/'
if a:count < 0 && !empty(merge)
if a:count < 0
let commit = merge
else
let commit = ''
if len(merge)
elseif len(merge)
let owner = s:Owner(@%, dir)
let commit = s:ChompDefault('', ['merge-base', 'refs/remotes/' . remote . '/' . merge, empty(owner) ? '@' : owner, '--'], dir)
if line2 > 0 && empty(arg) && commit =~# '^\x\{40,\}$'
@@ -7393,7 +7391,6 @@ function! fugitive#BrowseCommand(line1, count, range, bang, mods, arg, ...) abor
endif
endif
endif
endif
if empty(commit)
let commit = readfile(fugitive#Find('.git/HEAD', dir), '', 1)[0]
endif