Small improvement for untracked feature

first argument of git status is <pathspec> in git speech,
and so if you feed it a directory, that contained an untracked file,
the directory would be marked as untracked. So fix this.
This commit is contained in:
Christian Brabandt 2016-02-05 23:07:47 +01:00
parent fdb74f549d
commit 0022de3b78
1 changed files with 4 additions and 2 deletions

View File

@ -73,8 +73,10 @@ function! s:get_git_untracked(file)
if has_key(s:untracked_git, a:file) if has_key(s:untracked_git, a:file)
let untracked = s:untracked_git[a:file] let untracked = s:untracked_git[a:file]
else else
let untracked = ((system('git status --porcelain -- ' . a:file)[0:1]) is# '??' ? let output = system('git status --porcelain -- '. a:file)
\ get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists) : '') if output[0:1] is# '??' && output[3:-2] is? a:file
let untracked = get(g:, 'airline#extensions#branch#notexists', g:airline_symbols.notexists)
endif
let s:untracked_git[a:file] = untracked let s:untracked_git[a:file] = untracked
endif endif
return untracked return untracked