mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-13 05:43:52 -05:00
Optimize away log calls in :Gstatus if no upstream changes
This commit is contained in:
@@ -1620,6 +1620,7 @@ function! fugitive#BufReadStatus() abort
|
|||||||
|
|
||||||
let b:fugitive_files = {'Staged': {}, 'Unstaged': {}}
|
let b:fugitive_files = {'Staged': {}, 'Unstaged': {}}
|
||||||
let [staged, unstaged, untracked] = [[], [], []]
|
let [staged, unstaged, untracked] = [[], [], []]
|
||||||
|
let props = {}
|
||||||
|
|
||||||
if fugitive#GitVersion(2, 11)
|
if fugitive#GitVersion(2, 11)
|
||||||
let cmd += ['status', '--porcelain=v2', '-bz']
|
let cmd += ['status', '--porcelain=v2', '-bz']
|
||||||
@@ -1628,7 +1629,6 @@ function! fugitive#BufReadStatus() abort
|
|||||||
throw 'fugitive: ' . message
|
throw 'fugitive: ' . message
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let props = {}
|
|
||||||
let i = 0
|
let i = 0
|
||||||
while i < len(output)
|
while i < len(output)
|
||||||
let line = output[i]
|
let line = output[i]
|
||||||
@@ -1740,12 +1740,12 @@ function! fugitive#BufReadStatus() abort
|
|||||||
let push = pull
|
let push = pull
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if len(pull)
|
if len(pull) && get(props, 'branch.ab') !~# ' -0$'
|
||||||
let unpulled = s:QueryLog(head . '..' . pull)
|
let unpulled = s:QueryLog(head . '..' . pull)
|
||||||
else
|
else
|
||||||
let unpulled = []
|
let unpulled = []
|
||||||
endif
|
endif
|
||||||
if len(push)
|
if len(push) && !(push ==# pull && get(props, 'branch.ab') =~# '^+0 ')
|
||||||
let unpushed = s:QueryLog(push . '..' . head)
|
let unpushed = s:QueryLog(push . '..' . head)
|
||||||
else
|
else
|
||||||
let unpushed = []
|
let unpushed = []
|
||||||
|
|||||||
Reference in New Issue
Block a user