Merge branch 'sg/completion-remote' into maint

Code simplification.

* sg/completion-remote:
  completion: simplify __git_remotes()
  completion: add a test for __git_remotes() helper function
This commit is contained in:
Junio C Hamano
2015-03-23 11:23:33 -07:00
2 changed files with 21 additions and 5 deletions

View File

@ -411,12 +411,9 @@ __git_refs_remotes ()
__git_remotes ()
{
local i IFS=$'\n' d="$(__gitdir)"
local d="$(__gitdir)"
test -d "$d/remotes" && ls -1 "$d/remotes"
for i in $(git --git-dir="$d" config --get-regexp 'remote\..*\.url' 2>/dev/null); do
i="${i#remote.}"
echo "${i/.url*/}"
done
git --git-dir="$d" remote
}
__git_list_merge_strategies ()