Skip to content

Commit ecd061b

Browse files
authored
Update remote.py to fix issue #694
1 parent bfae362 commit ecd061b

File tree

1 file changed

+12
-4
lines changed

1 file changed

+12
-4
lines changed

git/remote.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,10 +536,18 @@ def urls(self):
536536
# and: http://stackoverflow.com/a/32991784/548792
537537
#
538538
if 'Unknown subcommand: get-url' in str(ex):
539-
remote_details = self.repo.git.remote("show", self.name)
540-
for line in remote_details.split('\n'):
541-
if ' Push URL:' in line:
542-
yield line.split(': ')[-1]
539+
try:
540+
remote_details = self.repo.git.remote("show", self.name)
541+
for line in remote_details.split('\n'):
542+
if ' Push URL:' in line:
543+
yield line.split(': ')[-1]
544+
except GitCommandError as ex:
545+
if 'correct access rights' in str(ex):
546+
# If ssh is not setup to access this repository, see issue 694
547+
result = Git().execute(['git','config','--get','remote.%s.url' % self.name])
548+
yield result
549+
else:
550+
raise ex
543551
else:
544552
raise ex
545553

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy