-
Notifications
You must be signed in to change notification settings - Fork 281
Fetch support. #224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Fetch support. #224
Changes from all commits
Commits
Show all changes
163 commits
Select commit
Hold shift + click to select a range
132f488
First pass at enabling fetches.
tiennou 9683b82
Add initializers for GTRemote.
tiennou 8ddbf4d
Allow getting a branch's remote directly.
tiennou e219d96
Setup the credential callback.
tiennou 25ac41d
Update libgit2 to libgit2/libgit2@85e1eded6a5302b25c339988a6828aa45fb…
tiennou 69a6870
Fix enum value that disappeared.
tiennou 32e16dd
API to get a remote's repository back.
tiennou 32d431c
Make that call block-based.
tiennou b1e068c
Add some missing accessors.
tiennou 9ae2de9
Review.
tiennou 99fd4f8
Cleanup our callbacks.
tiennou 9147337
Synchronize accesses on self.
tiennou fe0fcd4
Merge branch 'master' into fetch
tiennou f1e0fed
Fix error reporting.
tiennou 1f4a741
Add `BOOL *stop` parameters.
tiennou b66841d
Remove `-cancelOperation`.
tiennou b78b7a7
Add `-pushURLString` accessor.
tiennou 132d34b
Disconnect the remote after fetch.
tiennou 085bfcd
Merge branch 'master' into fetch
tiennou 53e72ac
Remote renaming.
tiennou 9b24687
Add setters for fetch & push URLs.
tiennou 016e600
Class methods for URL validity & support and name validity.
tiennou 326c2a1
Getter & setter for update_fetchhead.
tiennou 3e3741d
Getter & setter for the git_remote_autotag setting.
tiennou dbeb1c7
Merge branch 'master' into fetch
tiennou 951f2d3
Remove low-level fetch callbacks.
tiennou 2a52a5a
Oopsie.
tiennou df7797b
Use the higher-level progress callback.
tiennou 6a5962e
Wrong parameter.
tiennou 2da274b
Set the GTRepository in the git_remote initializer, not lazily.
tiennou 264e432
Allow remote to be created by tweaking the designated initializer.
tiennou 315c7fc
Documentation.
tiennou 82ef2b4
This doesn't need an `int` return.
tiennou e9eb978
Unused leftover that asserts.
tiennou 6ec740c
Merge branch 'master' into fetch
tiennou d8f467c
Pass the `GTRepository` in the libgit2 initializer.
tiennou 48cb468
Redeclare `repository` property so the ivar can be accessed.
tiennou 30466af
Consistent casing on `GTRemoteAutoTagOption`.
tiennou 95b4397
More unneeded stuff.
tiennou 1be6929
Better name.
tiennou 36b83c0
`url` => `URL`.
tiennou 7dce701
Unnecessary casts.
tiennou df9e8f7
Return GIT_ERROR to `libgit2` to indicate the rename wasn't handled.
tiennou 0ca55db
Use a `@try/@finally` block instead of `goto`.
tiennou 89435cd
Documentation.
tiennou 958de2c
Ghost parameter.
tiennou c0cddf8
Add NSError parameters to the class constructors.
tiennou 7e8d9c1
Forgot to change that one.
tiennou e5c6f1e
Add GTRemoteSpec.
tiennou 8be93a4
Add `-[GTRepository remoteNamesWithError:]
tiennou 95be58a
Ghost parameter.
tiennou 921b3cf
Add tests for the `-[GTRepository remoteNamesWithError:]`
tiennou 4c8b62e
Tests for `GTRemote`.
tiennou cb4a418
Use `gitDirectoryURL` since we're testing against a bare repo.
tiennou 358c700
Don't put a nil if libgit2 "forgot" to set an error message.
tiennou 69073fd
Better version.
tiennou da4acdd
Move that above, it's an accessor.
tiennou 3597084
One line `userInfo` creation.
tiennou 3820fbd
Update per review (the easy ones).
tiennou d04f203
Add a NULL test in case the remote name is NULL.
tiennou 3b46ae3
Test for `fetchWithError:…`. Not passing.
tiennou e94e011
Don't call `localizedDescription`.
tiennou a14aaea
Don't skip a commit, we're already on the first one.
tiennou 46f73ae
Merge branch 'master' into fetch
tiennou fcaee88
Clarify supported/valid URL.
tiennou d31823d
Use a GTCredentialProvider for authentication.
tiennou e38111a
Correct parameters order + docs.
tiennou 01fbe83
Unused typedef.
tiennou a2c219c
Fix tests.
tiennou 055425d
Ooops.
tiennou 6422662
Push support.
tiennou 8385bca
DRY the remote connection management.
tiennou 9051caf
One less function call (performance matters).
tiennou 7944375
Push doesn't support progress report.
tiennou c18ad46
Add `pushRefspecs` property.
tiennou 300422f
Spec for pushing.
tiennou ed50421
Convert local `file:` URLs to paths before handing over to `git_clone`.
tiennou 2561348
Merge branch 'fix-local-clone' into push
tiennou 36dc5f4
Comment normal push tests and provide a placeholder one instead.
tiennou f82ac62
Merge branch 'master' into fetch
tiennou 321d1a3
Updated to use the new `git_remote_callbacks` struct.
tiennou f7a63f5
One more test.
tiennou aa41ad5
Use the push refspecs set up on the remote internally.
tiennou 6ac1d81
Doc++;
tiennou ee4a798
Make the `testrepo.git` repo a real bare repo (again?).
tiennou 564e3b3
Update the tests that now fail because their repo is now bare.
tiennou dff9ece
`git_push_unpack_ok` returns 0/1, not an error.
tiennou 393d9b6
Make the network tests use the bare repo.
tiennou 9e656fc
Don't cause an assert if the branch is a local branch.
tiennou b00bd04
Make push work with local bare repositories.
tiennou f550b23
Use [at]onExit.
tiennou dbe3571
Use the actual push callbacks.
tiennou a8939d3
Remove cruft.
tiennou b2aa3c1
Rename test.
tiennou fe64125
Clarify FIXME.
tiennou 749bae7
Merge branch 'master' into fetch
tiennou bb31e14
Merge remote-tracking branch 'libgit2/master' into fetch
tiennou f7e65e5
Moving push & fetch support to GTRepository.
tiennou 34ba3fc
Use GIT_EUSER instead of magic values.
tiennou 2b1b414
Merge branch 'master' into fetch-repo
tiennou 4ff2704
Update API.
tiennou 545424d
Fix the GTIndex tests.
tiennou 6ae8d4c
Merge branch 'master' into fetch
pbendersky 0416a80
Merge pull request #393 from pbendersky/fetch
jspahrsummers fe53e2b
Merge branch 'master' into fetch
pbendersky 5154b01
Merge branch 'master' into fetch
pbendersky 9721263
Added GTRepository+RemoteOperations.{h,m} to ObjectiveGit-ios target.
pbendersky ee395c1
- Added constant for the credential provider dictionary key instead o…
pbendersky 8eccf6d
Merge pull request #401 from pbendersky/fetch
jspahrsummers 073dc08
Merge fix
tiennou 6389d67
Remove push support
tiennou d9ddd3b
Cleanup options and untyped things
tiennou 1070b18
Fix the tests
tiennou cf17a4b
- Added new method in GTRepository to get the FETCH_HEAD entries.
pbendersky 1510cea
- Removed `GTRepository` from `GTFetchHeadEntry` (we can get to the r…
pbendersky 401bf3d
Changed init method to return early.
pbendersky 7f223a9
Fixed wacky indentation
pbendersky defc906
Added method to enumerate fetch head entries.
pbendersky 6f48fe8
Added a third / to comments (see #402)
pbendersky e4d9317
Aligned comments
pbendersky 9861940
Removed nil check, as the enumerationBlock is guaranteed to be set in…
pbendersky aa67fc5
Added assert to check for nil parameter
pbendersky f36fc31
Removed wrong `__block` modifier.
pbendersky f35af60
Added assert for nil parameters.
pbendersky 503fe77
Merge pull request #404 from pbendersky/fetch
joshaber 64c09d6
De-hard-wrap line
tiennou b27d70c
URL -> URLString
tiennou c4da29f
id -> instancetype
tiennou 8fb43d7
Use `git_arrayWithStrarray` here
tiennou c033c41
Remove unnecessary definitions
tiennou 66825b7
Provide a nicer failure reason
tiennou a425175
Reversed logic FTW
tiennou 6a2eb3e
Renamed option in documentation
tiennou ffbcc17
Explicit nil comparison
tiennou 9f408ac
Embed a GTCredentialAcquireCallbackInfo instead of warning-comment th…
tiennou f51b848
Return GIT_EUSER to stop enumeration
tiennou 2f8160c
Remove [at]synchronized.
tiennou d3f4cca
Unnecessary conditional
tiennou 5f0b899
Free the strarrays!
tiennou 3b739da
Copy-pasta-fail
tiennou e5f1bb4
Move the RemoteOperation category next to its siblings
tiennou f934b16
Update the tests
tiennou 37107c8
Re-enable test
tiennou 06295d3
More reversed logic
tiennou 47706f5
Remove `-[GTBranch remote]`
tiennou 5533868
Merge remote-tracking branch 'libgit2/master' into fetch
tiennou 7b7f600
Update `RemoteOperations` with new-style comments
tiennou b9b0594
Merge-fail
tiennou 2593ebb
Cannot-be-nil-ify
tiennou f3e1380
Changed targetOID property to `copy` as it's an immutable type.
pbendersky fc766f4
Removed `+fetchEntryWithReference:` (no longer that useful with ARC)
pbendersky e79a88a
Changed parameter to remoteURLString instead of remoteURL
pbendersky fc6efba
Changed description implementation to use property accesor instead of…
pbendersky 741a444
Removed strarray convertion and used git_arrayWithStrarray instead.
pbendersky 5ed28b8
Add a `NSError+Git` method for customizing the error's userInfo.
tiennou 0489bd8
Use the new error method to return the refspecs that couldn't be rena…
tiennou 5f363f7
Compare != 0 instead of == 1.
tiennou 4c00640
Move enumeration code around.
tiennou b2887f7
Use local variable.
tiennou 6385b01
Test remote cloning through SSH.
tiennou 60de3e3
Don't use pointers for those things.
tiennou f01278a
Merge branch 'master' into fetch
tiennou 7160ff1
Just return a mutable array.
tiennou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// | ||
// GTFetchHeadEntry.h | ||
// ObjectiveGitFramework | ||
// | ||
// Created by Pablo Bendersky on 8/14/14. | ||
// Copyright (c) 2014 GitHub, Inc. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class GTRepository; | ||
@class GTOID; | ||
@class GTReference; | ||
|
||
/// A class representing an entry on the FETCH_HEAD file, as returned by the callback of git_repository_fetchhead_foreach. | ||
@interface GTFetchHeadEntry : NSObject | ||
|
||
/// The reference of this fetch entry. | ||
@property (nonatomic, readonly, strong) GTReference *reference; | ||
|
||
/// The remote URL where this entry was originally fetched from. | ||
@property (nonatomic, readonly, copy) NSString *remoteURLString; | ||
|
||
/// The target OID of this fetch entry (what we need to merge with) | ||
@property (nonatomic, readonly, copy) GTOID *targetOID; | ||
|
||
/// Flag indicating if we need to merge this entry or not. | ||
@property (nonatomic, getter = isMerge, readonly) BOOL merge; | ||
|
||
/// Initializes a GTFetchHeadEntry. | ||
/// | ||
/// reference - Reference on the repository. Cannot be nil. | ||
/// remoteURLString - URL String where this was originally fetched from. Cannot be nil. | ||
/// targetOID - Target OID. Cannot be nil. | ||
/// merge - Indicates if this is pending a merge. | ||
- (instancetype)initWithReference:(GTReference *)reference remoteURLString:(NSString *)remoteURLString targetOID:(GTOID *)targetOID isMerge:(BOOL)merge; | ||
|
||
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// | ||
// GTFetchHeadEntry.m | ||
// ObjectiveGitFramework | ||
// | ||
// Created by Pablo Bendersky on 8/14/14. | ||
// Copyright (c) 2014 GitHub, Inc. All rights reserved. | ||
// | ||
|
||
#import "GTFetchHeadEntry.h" | ||
#import "GTOID.h" | ||
|
||
@implementation GTFetchHeadEntry | ||
|
||
- (instancetype)initWithReference:(GTReference *)reference remoteURLString:(NSString *)remoteURLString targetOID:(GTOID *)targetOID isMerge:(BOOL)merge { | ||
NSParameterAssert(reference != nil); | ||
NSParameterAssert(remoteURLString != nil); | ||
NSParameterAssert(targetOID != nil); | ||
|
||
self = [super init]; | ||
if (self == nil) return nil; | ||
|
||
_reference = reference; | ||
_remoteURLString = [remoteURLString copy]; | ||
_targetOID = [targetOID copy]; | ||
_merge = merge; | ||
|
||
return self; | ||
} | ||
|
||
#pragma mark NSObject | ||
|
||
- (NSString *)description { | ||
return [NSString stringWithFormat:@"<%@: %p>{ reference: %@, remoteURL: %@, targetOID: %@, merge: %i }", self.class, self, self.reference, self.remoteURLString, self.targetOID, (int)self.merge]; | ||
} | ||
|
||
@end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This can use
-mutableCopy
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I was so annoyed by the duplication between this and the one above that it just flew above my head 😧.