mirror of
https://github.com/gosticks/SwiftGit2.git
synced 2025-10-16 11:55:34 +00:00
This introduces a new static function on Repository that will allow a
user to clone a local or remote repository.
At the moment only SSH in-memory, username + password and default (no
creds) are implemented.
It provides an enum wrapper around the underlying libgit2 `git_cred_t`
type to abstract it away from the user into something that is a little
more Swift-like. As much of the C callback code and struct creation has
been moved into Swift-land as well, this is now possible as of 2.*
whereas before it was not.
I had to use a wrapper class in Credentials.swift in order to convert
blocks to pointers, as blocks do not implement the AnyObject protocol
that `Unmanaged` requies.
The test requires you passing through a set of environment variables
otherwise it will not run. This is so that secret/private information
isn't leaked into the repository. The required variables are as follows:
- SG2TestPrivateRepo - the url of the private jrepo to clone;
- SG2TestUsername - the url of the user that will be connecting;
- SG2TestPublicKey - the public key data to be used;
- SG2TestPrivateKey - the private key data;
- SG2TestPassphrase - passphrase needed to use the private key (blank
if none).
|
||
|---|---|---|
| .. | ||
| Fixtures | ||
| FixturesSpec.swift | ||
| Info.plist | ||
| ObjectsSpec.swift | ||
| OIDSpec.swift | ||
| ReferencesSpec.swift | ||
| RemotesSpec.swift | ||
| RepositorySpec.swift | ||