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:
parent
fdb74f549d
commit
0022de3b78
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue