Commit Graph

39 Commits

Author SHA1 Message Date
Matt Rubin
e735a7d4cb Update project, source, and tests to build with Swift 2.3 2016-12-06 12:43:03 -05:00
Tom Booth
60cb395cc6 Add cloneFromURL function
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).
2016-04-07 14:50:38 +01:00
Matt Diephouse
1d28313725 Merge pull request #54 from tombooth/libgit2-to-v0.23.4
Upgrade libgit2 to v0.23.4
2016-02-27 18:40:48 -05:00
Tom Booth
8ea6f56fa0 Upgrade libgit2 to v0.23.4
The main reason for the upgrade is to enable use of SecureTransport for
https transport.

You can find a full diff here:

7c63a33ffe...e8feafe320

and the changelog changes:

7c63a33ffe...e8feafe320 (diff-4ac32a78649ca5bdd8e0ba38b7006a1e)
2016-02-26 16:20:37 +00:00
Tom Booth
433ef719eb Correct the dependency between openssl and libssh2
Previously, libgit2 was depending on both openssl and libssh2. This was
incorrect as libssh2 requires openssl for its build phase. I have moved
the openssl dependency back to libssh2.

I was testing using the scripts/cibuild executable, which masks any
dependency issues with openssl as it prebuilds it. This prebuilding was
done to get around TravisCI timeouts and so can't be removed to stop
this being missed again.
2016-02-23 18:26:00 +00:00
Tom Booth
6c0e55f3ca Structure xcode project for iOS
The commit contains all of the reconfiguration of the XCode project to
create a new iOS target and scheme. This follows, but occasionally
deviates from, the changes made in
https://github.com/SwiftGit2/SwiftGit2/pull/44. A couple of more
specific notes:

  - Disabled bitcode on iOS framework as the builds further down the
    chain won't currently generate bitcode. Not currently an issue but
    when Apple decided App Store can only contain bitcode it will be.
  - Update .gitignore to include directories generated as part of
    building openssl, libssh2 and libgit2. These are created as part of
    the build scripts borrowed from objective-git
  - Splits iOS/Mac libraries used into different groups for clarities
    sake
  - Set the debug and release configurations for the new targets to iOS
    Framework and Application
2016-02-22 11:17:41 +00:00
Tom Booth
aec66f930c Use ZipArchive to extract fixtures for tests
The current method used by this library uses NSTask to spin up an
externally running task to unzip the fixtures, this will not work on iOS
as this functionality is not allowed. Switching to use ZipArchive, as
noted by @modocache, provides a portable way of extracting fixtures.
2016-02-16 16:51:49 +00:00
Matt Diephouse
4149f2ce5d Set a higher deployment target for the tests
Guanaco seems to require 10.11+.
2016-01-17 11:26:02 -05:00
Markos Charatzas
5c8a6000c4 updated to Swift 2.0
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
2016-01-16 14:57:32 +00:00
Matt Diephouse
6e737b1190 Update to antitypical/Result 0.3 2015-04-20 19:51:27 -04:00
Matt Diephouse
03032d0074 Switch from LlamaKit to antitypical/Result 2015-04-15 21:32:10 -04:00
Matt Diephouse
7d32dbd36e Undo this linker flag 2015-04-13 22:27:02 -04:00
Matt Diephouse
bfe2d6d053 Add checkout strategies 2015-04-02 21:01:44 -04:00
Matt Diephouse
38ba66f80d Manage dependencies with Carthage 2015-03-08 16:30:30 -04:00
Brian Gesiak
186b5aadc9 .gitmodules: Xcode 6.3b2 updates
- 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.
2015-03-07 12:43:38 -05:00
Matt Diephouse
90ecfc3166 Sort Errors.swift alphabetically in project 2015-03-07 12:43:38 -05:00
Matt Diephouse
a1cdaf4422 Only copy the libgit2 headers that we need 2015-03-07 12:43:38 -05:00
Matt Diephouse
2d0c0765fc Add Repository.HEAD() 2015-03-07 12:43:37 -05:00
Brian Gesiak
ba9a951b62 Support Swift 1.2
- 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.
2015-02-21 21:28:43 -05:00
Brian Gesiak
7d6409a406 .gitmodules: Add Nimble
Instead of relying on the version of Nimble that Quick uses for its test
target, use a top-level submodule to version Nimble.
2015-02-20 01:47:49 -05:00
Brian Gesiak
17022d69d8 Repository: Propagate libgit2 errors
Instead of returning the default LlamaKit error, return the underlying
libgit2 error when Repository.atURL fails.
2015-02-19 13:37:38 -05:00
Brian Gesiak
908f774cc8 .gitmodules: Add Guanaco
Guanaco provides Nimble assertions for LlamaKit.Result, such as:

```
expect(result).to(haveFailed(domain: "com.libgit2"))
```

These custom assertions will be useful when testing that libgit2 error
messages are properly captured and reported.
2015-02-18 00:14:14 -05:00
Matt Diephouse
8b92b6f9ca Implement objectWithOID 2015-01-11 14:19:04 -08:00
Matt Diephouse
4a0b5cd838 Add Remotes 2015-01-03 09:43:42 -05:00
Matt Diephouse
e40e19a3fc Create files for remotes 2015-01-02 14:28:53 -05:00
Matt Diephouse
ecea586f73 Create files for references 2015-01-02 10:34:06 -05:00
Matt Diephouse
c9e8e3d36f Move pointers to their own file 2014-12-23 13:10:12 -10:00
Matt Diephouse
87e5914d89 Configure the project to use tabs 2014-12-19 16:46:26 -10:00
Matt Diephouse
b4dac5a6be Look up commits in the repository 2014-12-05 15:27:35 -05:00
Matt Diephouse
692a103ca7 Add an OID type 2014-11-18 20:48:28 -05:00
Matt Diephouse
b5673e8620 Actually load a repository 2014-11-17 00:31:33 -05:00
Matt Diephouse
070d0692bd Remove bogus settings that Xcode added 2014-11-16 19:47:23 -05:00
Matt Diephouse
01f1146b54 Initialize libgit2 2014-11-16 19:11:06 -05:00
Matt Diephouse
301d1d5891 Add LlamaKit 2014-11-13 22:15:01 -05:00
Matt Diephouse
2ab91165ea Add libgit2 2014-11-10 18:31:59 -05:00
Matt Diephouse
26efaf67c3 Use Quick and Nimble 2014-11-07 17:11:47 -05:00
Matt Diephouse
e6745d7164 Add a Repository class 2014-11-07 17:03:13 -05:00
Matt Diephouse
0bbd749bf4 Use xcconfigs 2014-11-07 16:53:16 -05:00
Matt Diephouse
0ba446dcf7 Create the project 2014-11-07 16:53:11 -05:00