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).
commit 1f2cc37d17c534d1df30824c8c462572dbd006df
Author: Dr. Kibitz <info@drkibitz.com>
Date: Fri Mar 18 23:30:46 2016 -0700
Check for progress completion to destroy/dealloc callback pointer
- Also some general cleanup
commit 792bb9d8a587b6d83dc9fd8e6119d6c79a23a679
Author: Dr. Kibitz <info@drkibitz.com>
Date: Fri Mar 18 10:05:03 2016 -0700
this is a progress callback, don't clean up anything here
commit ce3c88058716089f511c5dd64c8c40813df783e9
Author: Dr. Kibitz <info@drkibitz.com>
Date: Fri Mar 18 00:45:22 2016 -0700
remove one more uneeded type
commit 21b586ac57640d605af382d2b0f57d92900ab18e
Author: Dr. Kibitz <info@drkibitz.com>
Date: Fri Mar 18 00:44:46 2016 -0700
Use move instead
commit 88630c94dbcf0b91e0223f45897168736044297a
Author: Dr. Kibitz <info@drkibitz.com>
Date: Fri Mar 18 00:40:16 2016 -0700
address comments, dealloc after UnsafeMutablePointer alloc
commit e0fcfb82491dda4db815554a07b4c933d48ae420
Author: Dr. Kibitz <info@drkibitz.com>
Date: Fri Mar 18 00:39:51 2016 -0700
add git2.h back as public header
commit 79287c952d1e288c5426b5ee1c4b3a5f9ab4efe7
Author: Dr. Kibitz <info@drkibitz.com>
Date: Sun Mar 13 18:00:18 2016 -0700
Remove the implementation detail leak, implemented in swift
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.
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.
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
The two different test targets will bundle up the required fixtures
under different bundle identifiers, this corrects the identifier based
on platform.
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.
This brings further parity between the way SwiftGit2 and objective-git
build.
At the moment the pre-compilation of OpenSSL is commented out as this
external library is not currently included.
These scripts were borrowed from the objective-git project and utilized
in the branch that I am taking inspiration from
(https://github.com/SwiftGit2/SwiftGit2/pull/44). Bringing these up to
date includes some fixes for working with iOS. The changelog is as
follows:
Currently unmerged PR fixing script/cibuild for iphonesimulator:
https://github.com/libgit2/objective-git/pull/552
commit 24b2a886c0b61cf1dca0d55cac900b26616e50b9
Author: Ben Chatelain <ben@octop.ad>
Date: Mon Nov 9 21:49:13 2015 -0700
Fix libssh2 inclusion in libgit2 iOS build script
- Added CMAKE_PREFIX_PATH to arch-specific libssh2 root dir
- Added PKG_CONFIG_USE_CMAKE_PREFIX_PATH so things actually make
sense
- Removed unused LIBSSH2_INCLUDE_DIRS
commit dca46ad12a958095aca6ee431de842ca62857b11
Author: joe DeCapo <joe@polka.cat>
Date: Wed Sep 23 05:26:43 2015 -0500
Disable code signing during build
Attempting solution from:
http://stackoverflow.com/questions/27671854/travis-ci-fails-to-build-with-a-code-signing-error
commit 0dc6c60dc0c13ecb088b2a93a9ad24b9c72a9b99
Merge: 4447e70 c9da387
Author: Josh Abernathy <joshaber@gmail.com>
Date: Wed Sep 2 09:36:05 2015 -0400
Merge pull request #484 from phatblat/ben/ios-test-target
iOS Test target
commit 4447e700413adf920a665b138149a20344bc9c87
Merge: b7b2549 aa6dd45
Author: Josh Abernathy <joshaber@gmail.com>
Date: Mon Aug 31 11:53:55 2015 -0500
Merge pull request #497 from phatblat/ben/bootstrap
Just install any missing tools in bootstrap
commit 15f906ca2efa9d5ba67744d25a825c9bc75ad9e7
Author: Ben Chatelain <ben@octop.ad>
Date: Mon Aug 24 15:25:38 2015 -0600
Quote sdkflag
commit 2712c2a2beb294cd81ae44f733fdc9f17eb1a259
Author: Ben Chatelain <ben@octop.ad>
Date: Mon Aug 24 14:17:33 2015 -0600
Add specific iOS simulator destination
Specifying the destionation works around the following issue with
xctool. Can also hard-code the architecture, but this seems more
future-proof.
```
Failed to query the list of test cases in the test bundle:
2015-08-24 10:57:11.740 sim[50821:2746840]
/Applications/Xcode6.4.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/sim:
No simulator devices appear to be running. Setting data directories to
/var/empty.
2015-08-24 10:57:11.741 sim[50821:2746840] DYLD_INSERT_LIBRARIES
contains possible bad values. Caller beware:
/usr/local/Cellar/xctool/0.2.4/libexec/lib/otest-query-lib-ios.dylib
dlopen(/Volumes/DerivedData/ObjectiveGitFramework-drtqacfhlqybdcdpqayztrrwneun/Build/Products/Debug-iphonesimulator/ObjectiveGit-iOSTests.xctest/ObjectiveGit-iOSTests,
1): Library not loaded: @rpath/ObjectiveGit.framework/ObjectiveGit
Referenced from:
/Volumes/DerivedData/ObjectiveGitFramework-drtqacfhlqybdcdpqayztrrwneun/Build/Products/Debug-iphonesimulator/ObjectiveGit-iOSTests.xctest/ObjectiveGit-iOSTests
Reason: no suitable image found. Did find:
/Volumes/DerivedData/ObjectiveGitFramework-drtqacfhlqybdcdpqayztrrwneun/Build/Products/Debug-iphonesimulator/ObjectiveGit.framework/ObjectiveGit:
mach-o, but wrong architecture
```
Indeed, the "wrong architecture" message is correct as the framework
was built for a different architecture than the test binary:
```
lipo -info ObjectiveGit.framework/ObjectiveGit
ObjectiveGit-iOSTests.xctest/ObjectiveGit-iOSTests
2015-08-24 11:03
Non-fat file: ObjectiveGit.framework/ObjectiveGit is architecture:
i386
Non-fat file: ObjectiveGit-iOSTests.xctest/ObjectiveGit-iOSTests is
architecture: x86_64
```
commit aa6dd4531cf3380250045c3bb19839d3a40934f1
Author: Ben Chatelain <ben@octop.ad>
Date: Mon Aug 24 12:31:31 2015 -0600
/user -> /usr
commit b8efb3224393d12d720cbbbd348c2cb4ec066d6d
Author: Ben Chatelain <ben@octop.ad>
Date: Mon Aug 24 09:51:51 2015 -0600
Abort script if Homebrew is not installed
commit e7b8e1aa4bf6aa20de09ff4b112ec688570914d1
Author: Ben Chatelain <ben@octop.ad>
Date: Mon Aug 24 09:42:17 2015 -0600
Move check_deps to after update_submodules
commit 27473a0e8e92a47266664271ed4513806937efda
Author: Ben Chatelain <ben@octop.ad>
Date: Mon Aug 24 09:34:21 2015 -0600
Wrap long git submodule command chain for readability
commit 7724e36e7ca1666f535c8967c7534e04664d457e
Author: Ben Chatelain <ben@octop.ad>
Date: Sun Aug 9 09:12:56 2015 -0600
Update script comments
commit 768f033f0bf95c01793a941311cdbf45a7fb975c
Author: Ben Chatelain <ben@octop.ad>
Date: Sat Aug 8 22:51:14 2015 -0600
Fix iPhone SDK version detection in Xcode 7
commit cb0c5c12f9865e1aa270ed523ce0aeaf72c2be21
Author: Ben Chatelain <benchatelain@gmail.com>
Date: Tue Jul 28 22:44:01 2015 -0600
Just install any missing tools in bootstrap
Now REQUIRED_TOOLS is a mix of commands and libraries
commit 8dda480f788e006277767810b29d8a760028ce8b
Author: Piet Brauer <piet@nerdishbynature.com>
Date: Wed Jul 22 17:10:45 2015 +0200
Prebuild OpenSSL in order to workaround Travis timouts
commit 6c66e65c539e3b53db6c5531743dcfecdb116c55
Author: Ben Chatelain <ben@octop.ad>
Date: Mon Jul 20 21:45:01 2015 -0600
Stop letting cmake determine which clang to use
commit 2ea1bd02d33ed7fcd0604404dc98693ad89f3815
Author: joshaber <joshaber@gmail.com>
Date: Fri Jul 10 12:39:52 2015 -0400
Include pkg-config in our dependencies.
commit c906271f580d6901a1200fc4795df250aca47cfc
Author: Ben Chatelain <ben@octop.ad>
Date: Mon Jul 6 20:09:34 2015 -0600
Disable CURL in libgit2 iOS build
commit 549717d138fd4cd1828c7e67fb810523794f1ecb
Author: Ben Chatelain <ben@octop.ad>
Date: Mon Jul 6 20:09:16 2015 -0600
Remove obsolete OPENSSL_ defines from libgit2 iOS build
commit aed2cc39c831697102ac6aff317990729b55dd2c
Author: Ben Chatelain <ben@octop.ad>
Date: Thu Jun 25 21:16:56 2015 -0600
Fix LIBSSH2_INCLUDE_DIRS define
commit 5ba578ac115974f0981d49b7c79072e867ef804b
Author: Ben Chatelain <benchatelain@gmail.com>
Date: Tue Feb 17 17:10:32 2015 -0700
Fix libgit2 Mac build (again)
LIBSSH2_INCLUDE_DIR = /usr/local/include/
commit b0b011a9da2c784ef25e793a638c28c3b6387fd0
Author: Ben Chatelain <benchatelain@gmail.com>
Date: Mon Feb 16 16:25:15 2015 -0700
Revert "Fix libgit2 (Mac) build"
This reverts commit fd67e2bc2fc40171b06df88b627a636bdcf102cb.
commit fd67e2bc2fc40171b06df88b627a636bdcf102cb
Author: Ben Chatelain <benchatelain@gmail.com>
Date: Tue Feb 10 07:39:25 2015 -0700
Fix libgit2 (Mac) build
commit b817e13e4c29bea355044e316d9214fbc955ac8f
Author: Ben Chatelain <benchatelain@gmail.com>
Date: Mon Feb 9 08:40:20 2015 -0700
Fix libgit2-ios build
Set LIBSSH2_INCLUDE_DIR so that libssh2.h can be found
commit da4608b8a5bb87c3c75c7acdcc453fd69c6b8672
Author: Justin Spahr-Summers <Justin.SpahrSummers@gmail.com>
Date: Thu Nov 6 15:10:33 2014 -0800
Update objc-build-scripts to stop cleaning automatically
commit f8ff8a60bd0ca6dbfa7b170658c0be8f5f589cd6
Author: Alan Rogers <alanjrogers@me.com>
Date: Tue Oct 28 15:51:29 2014 +1100
Don't try and link .a's in the External folder.
commit 1e02f02ddcaf946f153449d604a0d60e2197aab8
Author: Alan Rogers <alanjrogers@me.com>
Date: Tue Oct 28 15:51:15 2014 +1100
Remove set -e because lol.
commit c32fe343651aacf91cbe3cf7d513c612f62b235e
Author: Alan Rogers <alanjrogers@me.com>
Date: Tue Oct 28 14:41:47 2014 +1100
Skip installing man pages to avoid too many symlink errors.
commit 88ee2eb305d3aeb1ece99c654f12da1fe2eadc40
Author: Justin Spahr-Summers <Justin.SpahrSummers@gmail.com>
Date: Wed Oct 22 11:51:32 2014 -0700
Update to jspahrsummers/objc-build-scripts@a54782c
commit 2c337c688a2779b51e6d4178cbace23750f3fde7
Author: Justin Spahr-Summers <jspahrsummers@github.com>
Date: Tue May 27 09:21:55 2014 -0700
Enable libgit2 thread safety for iOS
No idea why this was ever disabled.
Resolveslibgit2/libgit2#2384.
/cc @carlosmn @SquaredTiki
commit 19392f8a036dc603f115b6ced0d03f580dee0f47
Author: Justin Spahr-Summers <Justin.SpahrSummers@gmail.com>
Date: Mon Nov 11 11:47:33 2013 -0800
Add cmake as a required tool
commit 5b6cc97a958caedcc4dcbda18d1a193ed58a2ad6
Author: Justin Spahr-Summers <Justin.SpahrSummers@gmail.com>
Date: Mon Nov 11 11:37:54 2013 -0800
Update objc-build-scripts
During the upgrade to Swift 2.0 in `5c8a600` the dependency on the
library Box was removed, but the submodule wasn't fully.
This caused projects depending on SwiftGit2 to fail when Carthage was
recursively retrieving dependencies as it would find reference to Box
but no directory for it. The error I encountered was as below:
```
Parse error: expected submodule commit SHA in output of task (ls-tree -z ... Carthage/Checkouts/Box) but encountered:
```
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