| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -331,12 +331,11 @@ You can easily access configuration information for a remote by accessing option | |||
| 331 | 331 | :start-after: # [26-test_references_and_objects] | |
| 332 | 332 | :end-before: # ![26-test_references_and_objects] | |
| 333 | 333 | ||
| 334 | - You can also specify per-call custom environments using a new context manager on the Git command | ||
| 334 | + You can also specify per-call custom environments using a new context manager on the Git command, e.g. for using a specific SSH key. | ||
| 335 | 335 | ||
| 336 | - .. literalinclude:: ../../git/test/test_docs.py | ||
| 337 | - :language: python | ||
| 338 | - :start-after: # [32-test_references_and_objects] | ||
| 339 | - :end-before: # ![32-test_references_and_objects] | ||
| 336 | + ssh_cmd = 'ssh -i id_deployment_key' | ||
| 337 | + with repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd): | ||
| 338 | + repo.remotes.origin.fetch() | ||
| 340 | 339 | ||
| 341 | 340 | Submodule Handling | |
| 342 | 341 | ****************** | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -437,15 +437,6 @@ def test_references_and_objects(self, rw_dir): | |||
| 437 | 437 | git.for_each_ref() # '-' becomes '_' when calling it | |
| 438 | 438 | # ![31-test_references_and_objects] | |
| 439 | 439 | ||
| 440 | - # [32-test_references_and_objects] | ||
| 441 | - ssh_executable = os.path.join(rw_dir, 'my_ssh_executable.sh') | ||
| 442 | - with repo.git.custom_environment(GIT_SSH=ssh_executable): | ||
| 443 | - # Note that we don't actually make the call here, as our test-setup doesn't permit it to | ||
| 444 | - # succeed. | ||
| 445 | - # It will in your case :) | ||
| 446 | - repo.remotes.origin.fetch | ||
| 447 | - # ![32-test_references_and_objects] | ||
| 448 | - | ||
| 449 | 440 | def test_submodules(self): | |
| 450 | 441 | # [1-test_submodules] | |
| 451 | 442 | repo = self.rorepo | |
| Back | FazBrowse Home | New Git URL |
0 commit comments