File tree Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Expand file tree Collapse file tree 3 files changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -107,6 +107,19 @@ Refs
107107* Will dynmically retrieve their object at the time of query to assure the information
108108 is actual. Recently objects would be cached, hence ref object not be safely kept
109109 persistent.
110+
111+ Remote
112+ ------
113+ * Added Remote object allowing easy access to remotes
114+ * Repo.remotes lists all remotes
115+ * Repo.remote returns a remote of the specified name if it exists
116+
117+ Config
118+ ------
119+ * The git configuration can now be read and manipulated directly from within python
120+ using the GitConfigParser
121+ * Repo.config_reader returns a read-only parser
122+ * Repo.config_writer returns a read-write parser
110123
1111240.1.6
112125=====
Original file line number Diff line number Diff line change @@ -115,6 +115,20 @@ def remotes(self):
115115 A list of Remote objects allowing to access and manipulate remotes
116116 """
117117 return Remote .list_items (self )
118+
119+ def remote (self , name = 'origin' ):
120+ """
121+ Return
122+ Remote with the specified name
123+
124+ Raise
125+ ValueError if no remote with such a name exists
126+ """
127+ for remote in Remote .iter_items (self ):
128+ if remote .name == name :
129+ return remote
130+ # END for each existing remote
131+ raise ValueError ( "Remote named %s does not exist" % name )
118132
119133 # alias heads
120134 branches = heads
Original file line number Diff line number Diff line change @@ -67,6 +67,7 @@ def test_base(self):
6767 assert num_remotes
6868 assert num_remotes == len (remote_set )
6969
70+ origin = self .repo .remote ('origin' )
7071
7172 def test_creation_and_removal (self ):
7273 new_name = "test_new_one"
You can’t perform that action at this time.
0 commit comments