Skip to content

Commit

Permalink
Merge pull request #2939 from hashar/pip-freeze-with-git-not-named-or…
Browse files Browse the repository at this point in the history
…igin

pip freeze no more assumes git remote is 'origin'
  • Loading branch information
dstufft committed Mar 5, 2016
2 parents 90b2adb + 63f008a commit 0c22107
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions pip/vcs/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,12 @@ def obtain(self, dest):
self.update_submodules(dest)

def get_url(self, location):
url = self.run_command(
['config', 'remote.origin.url'],
"""Return URL of the first remote encountered."""
remotes = self.run_command(
['config', '--get-regexp', 'remote\..*\.url'],
show_stdout=False, cwd=location)
first_remote = remotes.splitlines()[0]
url = first_remote.split(' ')[1]
return url.strip()

def get_revision(self, location):
Expand Down

0 comments on commit 0c22107

Please sign in to comment.