git-project 0.0.28__tar.gz → 0.0.29__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {git_project-0.0.28 → git_project-0.0.29}/PKG-INFO +1 -1
- {git_project-0.0.28 → git_project-0.0.29}/_version.py +2 -2
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/git.py +6 -4
- {git_project-0.0.28 → git_project-0.0.29}/tests/test_git.py +15 -0
- git_project-0.0.28/.#pyproject.toml +0 -1
- git_project-0.0.28/git_project-0.0.28.dev1+g2184a37-py3-none-any.whl +0 -0
- git_project-0.0.28/git_project-0.0.28.dev1+g2184a37.tar.gz +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/.git +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/.gitignore +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/CONTRIBUTORS +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/COPYING +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/MANIFEST.in +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/docs/Makefile +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/docs/authors.rst +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/docs/changelog.rst +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/docs/conf.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/docs/index.rst +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/docs/intro.rst +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/docs/license.rst +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/docs/make.bat +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/pyproject.toml +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/requirements.txt +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/__init__.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/commandline.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/configobj.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/exception.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/gitproject.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/main.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/parsermanager.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/plugin.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/pluginmanager.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/project.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/runnable.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/scopedobj.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/shell.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/substitutable.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/test_support/__init__.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/src/git_project/test_support/common.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/test.out +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/tests/conftest.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/tests/test_confobj.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/tests/test_gitproject.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/tests/test_main.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/tests/test_project.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/tests/test_runnable.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/tests/test_scopedobj.py +0 -0
- {git_project-0.0.28 → git_project-0.0.29}/tests/test_substitutable.py +0 -0
|
@@ -58,10 +58,12 @@ class Git(object):
|
|
|
58
58
|
self.null_oid = pygit2.Oid(hex='0000000000000000000000000000000000000000')
|
|
59
59
|
|
|
60
60
|
def credentials(self, url, username_from_url, allowed_types):
|
|
61
|
-
if allowed_types & pygit2.
|
|
62
|
-
return pygit2.Keypair(
|
|
63
|
-
|
|
64
|
-
|
|
61
|
+
if allowed_types & pygit2.enums.CredentialType.SSH_KEY:
|
|
62
|
+
return pygit2.Keypair(
|
|
63
|
+
username_from_url, str(Path.home() / '.ssh' / 'id_rsa.pub'),
|
|
64
|
+
str(Path.home() / '.ssh' / 'id_rsa'), ''
|
|
65
|
+
)
|
|
66
|
+
elif allowed_types & pygit2.enums.CredentialType.USERNAME:
|
|
65
67
|
return pygit2.Username(username_from_url)
|
|
66
68
|
return None
|
|
67
69
|
|
|
@@ -21,6 +21,7 @@ import os
|
|
|
21
21
|
import git_project
|
|
22
22
|
|
|
23
23
|
from pathlib import Path
|
|
24
|
+
import pygit2
|
|
24
25
|
import shutil
|
|
25
26
|
|
|
26
27
|
def test_git_init(reset_directory,
|
|
@@ -874,3 +875,17 @@ def test_git_get_git_common_dir_renamed(reset_directory, local_repository):
|
|
|
874
875
|
|
|
875
876
|
assert git.has_repo()
|
|
876
877
|
assert Path(git.get_git_common_dir()).name == new_hidden_dir
|
|
878
|
+
|
|
879
|
+
|
|
880
|
+
def test_git_remote_credentials(reset_directory):
|
|
881
|
+
callback = git_project.Git.RemoteCallbacks();
|
|
882
|
+
|
|
883
|
+
key_result = callback.credentials(
|
|
884
|
+
'ssh:me@my.org/test.git', 'me', pygit2.enums.CredentialType.SSH_KEY
|
|
885
|
+
)
|
|
886
|
+
name_result = callback.credentials(
|
|
887
|
+
'ssh:me@my.org/test.git', 'me', pygit2.enums.CredentialType.USERNAME
|
|
888
|
+
)
|
|
889
|
+
|
|
890
|
+
assert isinstance(key_result, pygit2.Keypair)
|
|
891
|
+
assert isinstance(name_result, pygit2.Username)
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
dag@basie.2617:1746908671
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|