summaryrefslogtreecommitdiff
path: root/lib/git/repo.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-19 22:08:23 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-19 22:08:23 +0200
commit11b1f6edc164e2084e3ff034d3b65306c461a0be (patch)
treedd55246ddf747699fab7d105f6824e51a666e1b0 /lib/git/repo.py
parent985093bae160419782b3d3cb9151e2e58625fd52 (diff)
downloadgitpython-11b1f6edc164e2084e3ff034d3b65306c461a0be.tar.gz
repo.remote method added
CHANGES updated to carry information about remotes and config
Diffstat (limited to 'lib/git/repo.py')
-rw-r--r--lib/git/repo.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/git/repo.py b/lib/git/repo.py
index d5cc9782..0a8592ab 100644
--- a/lib/git/repo.py
+++ b/lib/git/repo.py
@@ -115,6 +115,20 @@ class Repo(object):
A list of Remote objects allowing to access and manipulate remotes
"""
return Remote.list_items(self)
+
+ def remote(self, name='origin'):
+ """
+ Return
+ Remote with the specified name
+
+ Raise
+ ValueError if no remote with such a name exists
+ """
+ for remote in Remote.iter_items(self):
+ if remote.name == name:
+ return remote
+ # END for each existing remote
+ raise ValueError( "Remote named %s does not exist" % name )
# alias heads
branches = heads