Skip to content
Snippets Groups Projects
Unverified Commit fb710600 authored by Jérôme Reybert's avatar Jérôme Reybert Committed by GitHub
Browse files

Merge pull request #195 from jreybert/next

Fix very slow update when large submodule
parents aaf1278f 421ecc94
Branches
Tags
No related merge requests found
......@@ -278,10 +278,12 @@ function! magit#git#git_unapply(header, selection, mode)
endtry
endfunction
" magit#git#submodule_status: helper function to return the submodule status
" return submodule status
function! magit#git#submodule_status()
return magit#sys#system(g:magit_git_cmd . " submodule status")
" magit#git#submodule_list: helper function to return the submodule list
" return array of submodule names
function! magit#git#submodule_list()
return map(split(magit#sys#system(
\ g:magit_git_cmd . " ls-files --stage | \grep 160000 || true"),
\ "\n"), 'split(v:val)[3]')
endfunction
" magit#git#get_branch_name: get the branch name given a reference
......
......@@ -10,7 +10,7 @@ let s:submodule_list = []
" magit#utils#refresh_submodule_list: this function refresh the List s:submodule_list
" magit#utils#is_submodule() is using s:submodule_list
function! magit#utils#refresh_submodule_list()
let s:submodule_list = map(split(magit#git#submodule_status(), "\n"), 'split(v:val)[1]')
let s:submodule_list = magit#git#submodule_list()
endfunction
" magit#utils#is_submodule search if dirname is in s:submodule_list
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment