Don't default to origin remote in bare repos

Resolves: https://github.com/tpope/vim-fugitive/issues/2129
This commit is contained in:
Tim Pope
2023-03-07 14:43:57 -05:00
parent f75dbb1967
commit 9b72d0c7c8

View File

@@ -2804,7 +2804,7 @@ function! fugitive#BufReadStatus(...) abort
endfor endfor
let fetch_remote = FugitiveConfigGet('branch.' . branch . '.remote', config) let fetch_remote = FugitiveConfigGet('branch.' . branch . '.remote', config)
if empty(fetch_remote) && !empty(FugitiveConfigGet('remote.origin.url', config)) if empty(fetch_remote) && !empty(s:Tree()) && !empty(FugitiveConfigGet('remote.origin.url', config))
let fetch_remote = 'origin' let fetch_remote = 'origin'
endif endif
let push_remote = FugitiveConfigGet('branch.' . branch . '.pushRemote', config) let push_remote = FugitiveConfigGet('branch.' . branch . '.pushRemote', config)