| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
2 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,10 +18,11 @@ | |||
| 18 | 18 | osp = os.path.dirname | |
| 19 | 19 | ||
| 20 | 20 | GIT_REPO = os.environ.get("GIT_PYTHON_TEST_GIT_REPO_BASE", osp(osp(osp(osp(__file__))))) | |
| 21 | + GIT_DAEMON_PORT = os.environ.get("GIT_PYTHON_TEST_GIT_DAEMON_PORT", "9418") | ||
| 21 | 22 | ||
| 22 | 23 | __all__ = ( | |
| 23 | 24 | 'fixture_path', 'fixture', 'absolute_project_path', 'StringProcessAdapter', | |
| 24 | - 'with_rw_repo', 'with_rw_and_rw_remote_repo', 'TestBase', 'TestCase', 'GIT_REPO' | ||
| 25 | + 'with_rw_repo', 'with_rw_and_rw_remote_repo', 'TestBase', 'TestCase', 'GIT_REPO', 'GIT_DAEMON_PORT' | ||
| 25 | 26 | ) | |
| 26 | 27 | ||
| 27 | 28 | #{ Routines | |
@@ -193,14 +194,15 @@ def remote_repo_creator(self): | |||
| 193 | 194 | # by the user, not by us | |
| 194 | 195 | d_remote = Remote.create(rw_repo, "daemon_origin", remote_repo_dir) | |
| 195 | 196 | d_remote.fetch() | |
| 196 | - remote_repo_url = "git://localhost%s" % remote_repo_dir | ||
| 197 | + remote_repo_url = "git://localhost:%s%s" % (GIT_DAEMON_PORT, remote_repo_dir) | ||
| 197 | 198 | ||
| 198 | 199 | d_remote.config_writer.set('url', remote_repo_url) | |
| 199 | 200 | ||
| 200 | 201 | temp_dir = osp(_mktemp()) | |
| 201 | 202 | # On windows, this will fail ... we deal with failures anyway and default to telling the user to do it | |
| 202 | 203 | try: | |
| 203 | - gd = Git().daemon(temp_dir, enable='receive-pack', as_process=True) | ||
| 204 | + gd = Git().daemon(temp_dir, enable='receive-pack', listen='127.0.0.1', port=GIT_DAEMON_PORT, | ||
| 205 | + as_process=True) | ||
| 204 | 206 | # yes, I know ... fortunately, this is always going to work if sleep time is just large enough | |
| 205 | 207 | time.sleep(0.5) | |
| 206 | 208 | except Exception: | |
@@ -223,6 +225,8 @@ def remote_repo_creator(self): | |||
| 223 | 225 | raise AssertionError(msg) | |
| 224 | 226 | else: | |
| 225 | 227 | msg = 'Please start a git-daemon to run this test, execute: git daemon --enable=receive-pack "%s"' | |
| 228 | + msg += 'You can also run the daemon on a different port by passing --port=<port>' | ||
| 229 | + msg += 'and setting the environment variable GIT_PYTHON_TEST_GIT_DAEMON_PORT to <port>' | ||
| 226 | 230 | msg %= temp_dir | |
| 227 | 231 | raise AssertionError(msg) | |
| 228 | 232 | # END make assertion | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,7 +8,8 @@ | |||
| 8 | 8 | TestBase, | |
| 9 | 9 | with_rw_repo, | |
| 10 | 10 | with_rw_and_rw_remote_repo, | |
| 11 | - fixture | ||
| 11 | + fixture, | ||
| 12 | + GIT_DAEMON_PORT | ||
| 12 | 13 | ) | |
| 13 | 14 | from git import ( | |
| 14 | 15 | RemoteProgress, | |
@@ -250,7 +251,7 @@ def get_info(res, remote, name): | |||
| 250 | 251 | # must clone with a local path for the repo implementation not to freak out | |
| 251 | 252 | # as it wants local paths only ( which I can understand ) | |
| 252 | 253 | other_repo = remote_repo.clone(other_repo_dir, shared=False) | |
| 253 | - remote_repo_url = "git://localhost%s" % remote_repo.git_dir | ||
| 254 | + remote_repo_url = "git://localhost:%s%s" % (GIT_DAEMON_PORT, remote_repo.git_dir) | ||
| 254 | 255 | ||
| 255 | 256 | # put origin to git-url | |
| 256 | 257 | other_origin = other_repo.remotes.origin | |
| Back | FazBrowse Home | New Git URL |
0 commit comments