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).
Previously when a block was passed into checkout() it would be copied
but then the memory would be freed as nothing had retained a reference
to the copy. This meant that when block() was called in
SG2CheckoutProgressCallback() it would crash due to an attempt to
execute a random chunk of memory that previously contained the block.
This code now retains the payload after copying it.
updated to Xcode 7.2 recommended settings
integrated with Nimble (v3.0.0), Quick (v0.8.0), Result (1.0.1)
integrated with Guanaco (5031bf67297afbe61ac0f2fbf3e3e8400b3f8888) that supports Swift 2.0
- Update submodules to eliminate new warnings, errors in Xcode 6.3b2.
- COpaquePointer.null() no longer available; instantiate with nil literal
instead.
- Fix warning when chaining optionals and optional casts.
- Update Guanaco, LlamaKit, Nimble, and Quick to versions that support
Swift 1.2.
- Update Xcode project and scheme files for "latest Xcode version"
parameters.
- Use Swift 1.2's new fallible casts for casts that may fail at runtime.
- Update Guanaco for improved matching on failures,
i.e.: `haveFailed(beAnError(domain: match("abc")))`.
- All functions that return Result objects now return sane errors for
failure cases.
- Unit tests verify libgit2 error is domain is used for most failures.
This is the first of a series of commits intended to resolve issue #10,
which calls for proper error handling.
One way to test that libgit2 error messages are being propagated through
Result failures is by asserting that the error's description or code
match the message or code we expect. In order to do so, LlamaKit's
ErrorType is unweildy, and not future-proof--it would be easier and
safer to write assertions based on NSError.
Upgrade LlamaKit to v0.5.0, the latest version that supports Swift 1.1,
in order to define results as type `Result<T, NSError>`.