| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -607,8 +607,11 @@ def _get_push_info(self, proc, progress): | |||
| 607 | 607 | # END for each line | |
| 608 | 608 | try: | |
| 609 | 609 | proc.wait() | |
| 610 | - except GitCommandError: | ||
| 610 | + except GitCommandError,e: | ||
| 611 | 611 | # if a push has rejected items, the command has non-zero return status | |
| 612 | + # a return status of 128 indicates a connection error - reraise the previous one | ||
| 613 | + if proc.poll() == 128: | ||
| 614 | + raise | ||
| 612 | 615 | pass | |
| 613 | 616 | # END exception handling | |
| 614 | 617 | return output | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -5,7 +5,7 @@ | |||
| 5 | 5 | # the BSD License: http://www.opensource.org/licenses/bsd-license.php | |
| 6 | 6 | ||
| 7 | 7 | import os | |
| 8 | - from git import Repo, Remote | ||
| 8 | + from git import Repo, Remote, GitCommandError | ||
| 9 | 9 | from unittest import TestCase | |
| 10 | 10 | import tempfile | |
| 11 | 11 | import shutil | |
@@ -166,7 +166,15 @@ def remote_repo_creator(self): | |||
| 166 | 166 | # by the user, not by us | |
| 167 | 167 | d_remote = Remote.create(rw_repo, "daemon_origin", remote_repo_dir) | |
| 168 | 168 | d_remote.fetch() | |
| 169 | - d_remote.config_writer.set('url', "git://localhost%s" % remote_repo_dir) | ||
| 169 | + remote_repo_url = "git://localhost%s" % remote_repo_dir | ||
| 170 | + d_remote.config_writer.set('url', remote_repo_url) | ||
| 171 | + | ||
| 172 | + # try to list remotes to diagnoes whether the server is up | ||
| 173 | + try: | ||
| 174 | + rw_repo.git.ls_remote(d_remote) | ||
| 175 | + except GitCommandError,e: | ||
| 176 | + print str(e) | ||
| 177 | + raise AssertionError('Please start a git-daemon to run this test, execute: git-daemon "%s"'%tempfile.gettempdir()) | ||
| 170 | 178 | ||
| 171 | 179 | try: | |
| 172 | 180 | return func(self, rw_repo, rw_remote_repo) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments