Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 158bc98

Browse filesBrowse files
committed
Replace GIT_SSH with GIT_SSH_COMMAND for SSH key management.
Also move untestable documentation out of test. Related: #234, #242
1 parent f51fe3e commit 158bc98
Copy full SHA for 158bc98

2 files changed

+4-14Lines changed: 4 additions & 14 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎doc/source/tutorial.rst‎

Copy file name to clipboardExpand all lines: doc/source/tutorial.rst
+4-5Lines changed: 4 additions & 5 deletions
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -331,12 +331,11 @@ You can easily access configuration information for a remote by accessing option
331331
:start-after: # [26-test_references_and_objects]
332332
:end-before: # ![26-test_references_and_objects]
333333

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.
335335

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()
340339

341340
Submodule Handling
342341
******************
Collapse file

‎git/test/test_docs.py‎

Copy file name to clipboardExpand all lines: git/test/test_docs.py
-9Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -437,15 +437,6 @@ def test_references_and_objects(self, rw_dir):
437437
git.for_each_ref() # '-' becomes '_' when calling it
438438
# ![31-test_references_and_objects]
439439

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-
449440
def test_submodules(self):
450441
# [1-test_submodules]
451442
repo = self.rorepo

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.