From accc7b8dcd3da97cf4981aa2bf8644601c99b7b5 Mon Sep 17 00:00:00 2001 From: wsdjeg Date: Fri, 22 Apr 2022 21:08:40 +0800 Subject: [PATCH] fix(branch): fix on_exit_show_branch function --- bundle/git.vim/autoload/git/branch.vim | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/bundle/git.vim/autoload/git/branch.vim b/bundle/git.vim/autoload/git/branch.vim index 940605a64..9ca811ef1 100644 --- a/bundle/git.vim/autoload/git/branch.vim +++ b/bundle/git.vim/autoload/git/branch.vim @@ -93,12 +93,14 @@ endfunction function! s:on_exit_show_branch(id, data, event) abort let pwd = get(s:job_pwds, 'jobid' . a:id, '') - if !has_key(s:branch_info, pwd) + if !has_key(s:branch_info, pwd) && !empty(pwd) let s:branch_info[pwd] = {} endif - call extend(s:branch_info[pwd], { - \ 'last_update_done' : localtime(), - \ }) + if !empty(pwd) + call extend(s:branch_info[pwd], { + \ 'last_update_done' : localtime(), + \ }) + endif endfunction function! git#branch#current(...) abort