Merge branch 'sg/completion-remote'
authorJunio C Hamano <gitster@pobox.com>
Tue, 17 Mar 2015 23:01:30 +0000 (16:01 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 17 Mar 2015 23:01:30 +0000 (16:01 -0700)
Code simplification.

* sg/completion-remote:
completion: simplify __git_remotes()
completion: add a test for __git_remotes() helper function

1  2 
contrib/completion/git-completion.bash
index c21190d7510c173482b7784f9e8c4bf0b56cb1e1,d722b0a895fd650d04eb710fa08911085abff4c5..f5ae5e3a8c8d9d7dcbd840cec0c353fc81e862c0
@@@ -411,12 -411,9 +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 ()
@@@ -1425,7 -1422,7 +1422,7 @@@ __git_log_gitk_options=
  # Options that go well for log and shortlog (not gitk)
  __git_log_shortlog_options="
        --author= --committer= --grep=
 -      --all-match
 +      --all-match --invert-grep
  "
  
  __git_log_pretty_formats="oneline short medium full fuller email raw format:"