Skip to content

Commit c4a38c9

Browse files
committed
Return first, not last, value for FugitiveConfigGet()
1 parent 2c999d4 commit c4a38c9

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

autoload/fugitive.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1118,7 +1118,7 @@ function! fugitive#Config(...) abort
11181118
let callback = a:000[1:-1]
11191119
endif
11201120
elseif a:0 >= 2 && type(a:2) == type({}) && has_key(a:2, 'GetAll')
1121-
return get(fugitive#ConfigGetAll(a:1, a:2), 0, default)
1121+
return get(fugitive#ConfigGetAll(a:1, a:2), -1, default)
11221122
elseif a:0 >= 2
11231123
let dir = s:Dir(a:2)
11241124
let name = a:1
@@ -1200,7 +1200,7 @@ function! s:config_GetAll(name) dict abort
12001200
endfunction
12011201

12021202
function! s:config_Get(name, ...) dict abort
1203-
return get(self.GetAll(a:name), 0, a:0 ? a:1 : '')
1203+
return get(self.GetAll(a:name), -1, a:0 ? a:1 : '')
12041204
endfunction
12051205

12061206
function! s:config_GetRegexp(pattern) dict abort

plugin/fugitive.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ endfunction
168168
" argument can be either the object returned by FugitiveConfig(), or a Git
169169
" dir or buffer number to be passed along to FugitiveConfig().
170170
function! FugitiveConfigGet(name, ...) abort
171-
return get(call('FugitiveConfigGetAll', [a:name] + (a:0 ? [a:1] : [])), 0, get(a:, 2, ''))
171+
return get(call('FugitiveConfigGetAll', [a:name] + (a:0 ? [a:1] : [])), -1, get(a:, 2, ''))
172172
endfunction
173173

174174
" FugitiveConfigGetAll() is like FugitiveConfigGet() but returns a list of

0 commit comments

Comments
 (0)