Skip to content

Commit bf74b2a

Browse files
committed
Merge remote-tracking branch 'white-gecko/patch-1'
2 parents a149457 + 39a50d9 commit bf74b2a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

docs/recipes/git-clone-ssh.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Example for cloning a git repository over ssh.
1313
class MyRemoteCallbacks(pygit2.RemoteCallbacks):
1414
1515
def credentials(self, url, username_from_url, allowed_types):
16-
if allowed_types == pygit2.GIT_CREDTYPE_USERNAME:
16+
if allowed_types & pygit2.credentials.GIT_CREDTYPE_USERNAME:
1717
return pygit2.Username("git")
18-
elif allowed_types == pygit2.GIT_CREDTYPE_SSH_KEY:
18+
elif allowed_types & pygit2.credentials.GIT_CREDTYPE_SSH_KEY:
1919
return pygit2.Keypair("git", "id_rsa.pub", "id_rsa", "")
2020
else:
2121
return None

0 commit comments

Comments
 (0)