review: Fix exception running review on some detached HEADs.

(imported from commit 8f6e4a82ade10945cfac0104e4f8ff5d48379348)
This commit is contained in:
Tim Abbott 2013-01-30 11:09:38 -05:00
parent f701a38287
commit b81aa35c24
1 changed files with 3 additions and 0 deletions

View File

@ -104,6 +104,9 @@ def get_default_remote(repo):
except git.exc.GitCommandError:
try:
branch = repo.active_branch
except TypeError:
return 'origin'
try:
return repo.git.config('--get', 'branch.%s.remote' % branch)
except git.exc.GitCommandError:
return 'origin'