Skip to content

Adding support for git remote set-url/get-url API to Remote #446

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Switching the urls property to use git remote show instead of `gi…
…t remote get-url`

`get-url` is a new API that is not widely available yet (introduced in git 2.7.0), and
provokes failure on travis.

Signed-off-by: Guyzmo <guyzmo+github@m0g.net>
  • Loading branch information
guyzmo committed Jun 8, 2016
commit 3f4b410c955ea08bfb7842320afa568090242679
8 changes: 4 additions & 4 deletions git/remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -477,10 +477,10 @@ def delete_url(self, url, **kwargs):
def urls(self):
""":return: Iterator yielding all configured URL targets on a remote
as strings"""
scmd = 'get-url'
kwargs = {'insert_kwargs_after': scmd}
for url in self.repo.git.remote(scmd, self.name, all=True, **kwargs).split('\n'):
yield url
remote_details = self.repo.git.remote("show", self.name)
for line in remote_details.split('\n'):
if ' Push URL:' in line:
yield line.split(': ')[-1]

@property
def refs(self):
Expand Down