mirror of
https://github.com/tpope/vim-fugitive.git
synced 2025-11-15 23:03:51 -05:00
Reject remotes without appropriate push/fetch key
Verifying by URL is insufficient, as git clone --bare will create a remote with a URL but not a fetch key, resulting in no refs in refs/remotes/. Resolves: https://github.com/tpope/vim-fugitive/issues/2129
This commit is contained in:
@@ -2803,19 +2803,15 @@ function! fugitive#BufReadStatus(...) abort
|
|||||||
let b:fugitive_files['Unstaged'][dict.filename] = dict
|
let b:fugitive_files['Unstaged'][dict.filename] = dict
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
let fetch_remote = FugitiveConfigGet('branch.' . branch . '.remote', config)
|
let fetch_remote = config.Get('branch.' . branch . '.remote', 'origin')
|
||||||
if empty(fetch_remote) && !empty(s:Tree()) && !empty(FugitiveConfigGet('remote.origin.url', config))
|
let push_remote = config.Get('branch.' . branch . '.pushRemote',
|
||||||
let fetch_remote = 'origin'
|
\ config.Get('remote.pushDefault', fetch_remote))
|
||||||
|
if empty(config.Get('remote.' . fetch_remote . '.fetch'))
|
||||||
|
let fetch_remote = ''
|
||||||
endif
|
endif
|
||||||
let push_remote = FugitiveConfigGet('branch.' . branch . '.pushRemote', config)
|
if empty(config.Get('remote.' . push_remote . '.push', config.Get('remote.' . push_remote . '.fetch')))
|
||||||
if empty(push_remote)
|
|
||||||
let push_remote = FugitiveConfigGet('remote.pushDefault', config)
|
|
||||||
if empty(push_remote)
|
|
||||||
let push_remote = fetch_remote
|
|
||||||
elseif empty(FugitiveConfigGet('remote.' . push_remote . '.url', config))
|
|
||||||
let push_remote = ''
|
let push_remote = ''
|
||||||
endif
|
endif
|
||||||
endif
|
|
||||||
|
|
||||||
let pull_type = 'Pull'
|
let pull_type = 'Pull'
|
||||||
if empty(fetch_remote) || empty(branch)
|
if empty(fetch_remote) || empty(branch)
|
||||||
|
|||||||
Reference in New Issue
Block a user