Permalink
Browse files

editremotes: Simplify getting remote names

Use `git remote` to get the remote repository names.
This is simpler and faster then searching for git config
variables matching 'remote.*.url'.

Closes #123

Signed-off-by: David Aguilar <davvid@gmail.com>
  • Loading branch information...
1 parent a06d150 commit ff5305800bc89a60941f62e20ba9a1b1db4caeb1 @davvid davvid committed Apr 13, 2012
Showing with 1 addition and 6 deletions.
  1. +1 −6 cola/widgets/editremotes.py
@@ -6,7 +6,6 @@
import cola.app
from cola import core
from cola import qtutils
-from cola import gitcfg
from cola.git import git
from cola.widgets import defs
from cola.widgets import text
@@ -40,7 +39,6 @@ def __init__(self, parent):
self.info.setMinimumHeight(height)
self.info_thread = RemoteInfoThread(self)
- self.cfg = gitcfg.instance()
self.add_btn = QtGui.QToolButton()
self.add_btn.setIcon(qtutils.icon('add.svg'))
self.add_btn.setToolTip(self.tr('Add new remote git repository'))
@@ -95,10 +93,7 @@ def __init__(self, parent):
self.selection_changed)
def refresh(self):
- prefix = len('remote.')
- suffix = len('.url')
- remote_urls = self.cfg.find('remote.*.url')
- remotes = [k[prefix:-suffix] for k in sorted(remote_urls.keys())]
+ remotes = core.decode(git.remote()).splitlines()
self.remotes.clear()
self.remotes.addItems(remotes)
self.remote_list = remotes

0 comments on commit ff53058

Please sign in to comment.