Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace GIT_SSH with GIT_SSH_COMMAND for SSH key management. #256

Merged
merged 1 commit into from
Apr 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions doc/source/tutorial.rst
Original file line number Diff line number Diff line change
Expand Up @@ -331,12 +331,11 @@ You can easily access configuration information for a remote by accessing option
:start-after: # [26-test_references_and_objects]
:end-before: # ![26-test_references_and_objects]

You can also specify per-call custom environments using a new context manager on the Git command
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.

.. literalinclude:: ../../git/test/test_docs.py
:language: python
:start-after: # [32-test_references_and_objects]
:end-before: # ![32-test_references_and_objects]
ssh_cmd = 'ssh -i id_deployment_key'
with repo.git.custom_environment(GIT_SSH_COMMAND=ssh_cmd):
repo.remotes.origin.fetch()

Submodule Handling
******************
Expand Down
9 changes: 0 additions & 9 deletions git/test/test_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,15 +437,6 @@ def test_references_and_objects(self, rw_dir):
git.for_each_ref() # '-' becomes '_' when calling it
# ![31-test_references_and_objects]

# [32-test_references_and_objects]
ssh_executable = os.path.join(rw_dir, 'my_ssh_executable.sh')
with repo.git.custom_environment(GIT_SSH=ssh_executable):
# Note that we don't actually make the call here, as our test-setup doesn't permit it to
# succeed.
# It will in your case :)
repo.remotes.origin.fetch
# ![32-test_references_and_objects]

def test_submodules(self):
# [1-test_submodules]
repo = self.rorepo
Expand Down