Skip to content

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 163 commits into from
Sep 11, 2014
Merged
Show file tree
Hide file tree
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 Jul 3, 2013
9683b82
Add initializers for GTRemote.
tiennou Jul 3, 2013
8ddbf4d
Allow getting a branch's remote directly.
tiennou Jul 3, 2013
e219d96
Setup the credential callback.
tiennou Jul 3, 2013
25ac41d
Update libgit2 to libgit2/libgit2@85e1eded6a5302b25c339988a6828aa45fb…
tiennou Jul 15, 2013
69a6870
Fix enum value that disappeared.
tiennou Jul 15, 2013
32e16dd
API to get a remote's repository back.
tiennou Jul 15, 2013
32d431c
Make that call block-based.
tiennou Jul 15, 2013
b1e068c
Add some missing accessors.
tiennou Jul 15, 2013
9ae2de9
Review.
tiennou Jul 16, 2013
99fd4f8
Cleanup our callbacks.
tiennou Jul 16, 2013
9147337
Synchronize accesses on self.
tiennou Jul 16, 2013
fe0fcd4
Merge branch 'master' into fetch
tiennou Jul 16, 2013
f1e0fed
Fix error reporting.
tiennou Jul 17, 2013
1f4a741
Add `BOOL *stop` parameters.
tiennou Jul 17, 2013
b66841d
Remove `-cancelOperation`.
tiennou Jul 17, 2013
b78b7a7
Add `-pushURLString` accessor.
tiennou Jul 17, 2013
132d34b
Disconnect the remote after fetch.
tiennou Jul 17, 2013
085bfcd
Merge branch 'master' into fetch
tiennou Jul 17, 2013
53e72ac
Remote renaming.
tiennou Jul 17, 2013
9b24687
Add setters for fetch & push URLs.
tiennou Jul 17, 2013
016e600
Class methods for URL validity & support and name validity.
tiennou Jul 17, 2013
326c2a1
Getter & setter for update_fetchhead.
tiennou Jul 17, 2013
3e3741d
Getter & setter for the git_remote_autotag setting.
tiennou Jul 17, 2013
dbeb1c7
Merge branch 'master' into fetch
tiennou Sep 3, 2013
951f2d3
Remove low-level fetch callbacks.
tiennou Sep 3, 2013
2a52a5a
Oopsie.
tiennou Sep 3, 2013
df7797b
Use the higher-level progress callback.
tiennou Sep 3, 2013
6a5962e
Wrong parameter.
tiennou Sep 3, 2013
2da274b
Set the GTRepository in the git_remote initializer, not lazily.
tiennou Sep 4, 2013
264e432
Allow remote to be created by tweaking the designated initializer.
tiennou Sep 4, 2013
315c7fc
Documentation.
tiennou Sep 4, 2013
82ef2b4
This doesn't need an `int` return.
tiennou Sep 4, 2013
e9eb978
Unused leftover that asserts.
tiennou Sep 4, 2013
6ec740c
Merge branch 'master' into fetch
tiennou Sep 4, 2013
d8f467c
Pass the `GTRepository` in the libgit2 initializer.
tiennou Sep 4, 2013
48cb468
Redeclare `repository` property so the ivar can be accessed.
tiennou Sep 4, 2013
30466af
Consistent casing on `GTRemoteAutoTagOption`.
tiennou Sep 4, 2013
95b4397
More unneeded stuff.
tiennou Sep 4, 2013
1be6929
Better name.
tiennou Sep 4, 2013
36b83c0
`url` => `URL`.
tiennou Sep 4, 2013
7dce701
Unnecessary casts.
tiennou Sep 4, 2013
df9e8f7
Return GIT_ERROR to `libgit2` to indicate the rename wasn't handled.
tiennou Sep 4, 2013
0ca55db
Use a `@try/@finally` block instead of `goto`.
tiennou Sep 4, 2013
89435cd
Documentation.
tiennou Sep 4, 2013
958de2c
Ghost parameter.
tiennou Sep 4, 2013
c0cddf8
Add NSError parameters to the class constructors.
tiennou Sep 5, 2013
7e8d9c1
Forgot to change that one.
tiennou Sep 5, 2013
e5c6f1e
Add GTRemoteSpec.
tiennou Sep 6, 2013
8be93a4
Add `-[GTRepository remoteNamesWithError:]
tiennou Sep 6, 2013
95be58a
Ghost parameter.
tiennou Sep 6, 2013
921b3cf
Add tests for the `-[GTRepository remoteNamesWithError:]`
tiennou Sep 6, 2013
4c8b62e
Tests for `GTRemote`.
tiennou Sep 6, 2013
cb4a418
Use `gitDirectoryURL` since we're testing against a bare repo.
tiennou Sep 6, 2013
358c700
Don't put a nil if libgit2 "forgot" to set an error message.
tiennou Sep 6, 2013
69073fd
Better version.
tiennou Sep 6, 2013
da4acdd
Move that above, it's an accessor.
tiennou Sep 10, 2013
3597084
One line `userInfo` creation.
tiennou Sep 10, 2013
3820fbd
Update per review (the easy ones).
tiennou Sep 10, 2013
d04f203
Add a NULL test in case the remote name is NULL.
tiennou Sep 10, 2013
3b46ae3
Test for `fetchWithError:…`. Not passing.
tiennou Sep 10, 2013
e94e011
Don't call `localizedDescription`.
tiennou Sep 10, 2013
a14aaea
Don't skip a commit, we're already on the first one.
tiennou Sep 10, 2013
46f73ae
Merge branch 'master' into fetch
tiennou Oct 23, 2013
fcaee88
Clarify supported/valid URL.
tiennou Oct 23, 2013
d31823d
Use a GTCredentialProvider for authentication.
tiennou Oct 23, 2013
e38111a
Correct parameters order + docs.
tiennou Oct 23, 2013
01fbe83
Unused typedef.
tiennou Oct 23, 2013
a2c219c
Fix tests.
tiennou Oct 23, 2013
055425d
Ooops.
tiennou Oct 23, 2013
6422662
Push support.
tiennou Sep 10, 2013
8385bca
DRY the remote connection management.
tiennou Oct 23, 2013
9051caf
One less function call (performance matters).
tiennou Oct 23, 2013
7944375
Push doesn't support progress report.
tiennou Oct 24, 2013
c18ad46
Add `pushRefspecs` property.
tiennou Oct 24, 2013
300422f
Spec for pushing.
tiennou Oct 24, 2013
ed50421
Convert local `file:` URLs to paths before handing over to `git_clone`.
tiennou Oct 24, 2013
2561348
Merge branch 'fix-local-clone' into push
tiennou Oct 24, 2013
36dc5f4
Comment normal push tests and provide a placeholder one instead.
tiennou Oct 24, 2013
f82ac62
Merge branch 'master' into fetch
tiennou Nov 6, 2013
321d1a3
Updated to use the new `git_remote_callbacks` struct.
tiennou Nov 6, 2013
f7a63f5
One more test.
tiennou Nov 6, 2013
aa41ad5
Use the push refspecs set up on the remote internally.
tiennou Nov 6, 2013
6ac1d81
Doc++;
tiennou Nov 6, 2013
ee4a798
Make the `testrepo.git` repo a real bare repo (again?).
tiennou Nov 6, 2013
564e3b3
Update the tests that now fail because their repo is now bare.
tiennou Nov 6, 2013
dff9ece
`git_push_unpack_ok` returns 0/1, not an error.
tiennou Nov 6, 2013
393d9b6
Make the network tests use the bare repo.
tiennou Nov 6, 2013
9e656fc
Don't cause an assert if the branch is a local branch.
tiennou Nov 6, 2013
b00bd04
Make push work with local bare repositories.
tiennou Nov 6, 2013
f550b23
Use [at]onExit.
tiennou Nov 6, 2013
dbe3571
Use the actual push callbacks.
tiennou Nov 6, 2013
a8939d3
Remove cruft.
tiennou Nov 6, 2013
b2aa3c1
Rename test.
tiennou Nov 6, 2013
fe64125
Clarify FIXME.
tiennou Nov 6, 2013
749bae7
Merge branch 'master' into fetch
tiennou Nov 18, 2013
bb31e14
Merge remote-tracking branch 'libgit2/master' into fetch
tiennou Jan 15, 2014
f7e65e5
Moving push & fetch support to GTRepository.
tiennou Jan 15, 2014
34ba3fc
Use GIT_EUSER instead of magic values.
tiennou Jan 15, 2014
2b1b414
Merge branch 'master' into fetch-repo
tiennou Mar 30, 2014
4ff2704
Update API.
tiennou Mar 30, 2014
545424d
Fix the GTIndex tests.
tiennou Mar 30, 2014
6ae8d4c
Merge branch 'master' into fetch
pbendersky Aug 1, 2014
0416a80
Merge pull request #393 from pbendersky/fetch
jspahrsummers Aug 1, 2014
fe53e2b
Merge branch 'master' into fetch
pbendersky Aug 5, 2014
5154b01
Merge branch 'master' into fetch
pbendersky Aug 12, 2014
9721263
Added GTRepository+RemoteOperations.{h,m} to ObjectiveGit-ios target.
pbendersky Aug 12, 2014
ee395c1
- Added constant for the credential provider dictionary key instead o…
pbendersky Aug 13, 2014
8eccf6d
Merge pull request #401 from pbendersky/fetch
jspahrsummers Aug 14, 2014
073dc08
Merge fix
tiennou Aug 14, 2014
6389d67
Remove push support
tiennou Aug 14, 2014
d9ddd3b
Cleanup options and untyped things
tiennou Aug 14, 2014
1070b18
Fix the tests
tiennou Aug 14, 2014
cf17a4b
- Added new method in GTRepository to get the FETCH_HEAD entries.
pbendersky Aug 14, 2014
1510cea
- Removed `GTRepository` from `GTFetchHeadEntry` (we can get to the r…
pbendersky Aug 15, 2014
401bf3d
Changed init method to return early.
pbendersky Aug 15, 2014
7f223a9
Fixed wacky indentation
pbendersky Aug 15, 2014
defc906
Added method to enumerate fetch head entries.
pbendersky Aug 15, 2014
6f48fe8
Added a third / to comments (see #402)
pbendersky Aug 15, 2014
e4d9317
Aligned comments
pbendersky Aug 21, 2014
9861940
Removed nil check, as the enumerationBlock is guaranteed to be set in…
pbendersky Aug 21, 2014
aa67fc5
Added assert to check for nil parameter
pbendersky Aug 21, 2014
f36fc31
Removed wrong `__block` modifier.
pbendersky Aug 21, 2014
f35af60
Added assert for nil parameters.
pbendersky Aug 21, 2014
503fe77
Merge pull request #404 from pbendersky/fetch
joshaber Aug 22, 2014
64c09d6
De-hard-wrap line
tiennou Aug 26, 2014
b27d70c
URL -> URLString
tiennou Aug 26, 2014
c4da29f
id -> instancetype
tiennou Aug 26, 2014
8fb43d7
Use `git_arrayWithStrarray` here
tiennou Aug 26, 2014
c033c41
Remove unnecessary definitions
tiennou Aug 26, 2014
66825b7
Provide a nicer failure reason
tiennou Aug 26, 2014
a425175
Reversed logic FTW
tiennou Aug 26, 2014
6a2eb3e
Renamed option in documentation
tiennou Aug 26, 2014
ffbcc17
Explicit nil comparison
tiennou Aug 26, 2014
9f408ac
Embed a GTCredentialAcquireCallbackInfo instead of warning-comment th…
tiennou Aug 26, 2014
f51b848
Return GIT_EUSER to stop enumeration
tiennou Aug 26, 2014
2f8160c
Remove [at]synchronized.
tiennou Aug 26, 2014
d3f4cca
Unnecessary conditional
tiennou Aug 26, 2014
5f0b899
Free the strarrays!
tiennou Aug 26, 2014
3b739da
Copy-pasta-fail
tiennou Aug 26, 2014
e5f1bb4
Move the RemoteOperation category next to its siblings
tiennou Aug 26, 2014
f934b16
Update the tests
tiennou Aug 26, 2014
37107c8
Re-enable test
tiennou Aug 26, 2014
06295d3
More reversed logic
tiennou Aug 26, 2014
47706f5
Remove `-[GTBranch remote]`
tiennou Aug 26, 2014
5533868
Merge remote-tracking branch 'libgit2/master' into fetch
tiennou Aug 26, 2014
7b7f600
Update `RemoteOperations` with new-style comments
tiennou Aug 26, 2014
b9b0594
Merge-fail
tiennou Aug 26, 2014
2593ebb
Cannot-be-nil-ify
tiennou Aug 26, 2014
f3e1380
Changed targetOID property to `copy` as it's an immutable type.
pbendersky Aug 29, 2014
fc766f4
Removed `+fetchEntryWithReference:` (no longer that useful with ARC)
pbendersky Aug 29, 2014
e79a88a
Changed parameter to remoteURLString instead of remoteURL
pbendersky Aug 29, 2014
fc6efba
Changed description implementation to use property accesor instead of…
pbendersky Aug 29, 2014
741a444
Removed strarray convertion and used git_arrayWithStrarray instead.
pbendersky Aug 29, 2014
5ed28b8
Add a `NSError+Git` method for customizing the error's userInfo.
tiennou Sep 4, 2014
0489bd8
Use the new error method to return the refspecs that couldn't be rena…
tiennou Sep 4, 2014
5f363f7
Compare != 0 instead of == 1.
tiennou Sep 4, 2014
4c00640
Move enumeration code around.
tiennou Sep 4, 2014
b2887f7
Use local variable.
tiennou Sep 4, 2014
6385b01
Test remote cloning through SSH.
tiennou Sep 4, 2014
60de3e3
Don't use pointers for those things.
tiennou Sep 4, 2014
f01278a
Merge branch 'master' into fetch
tiennou Sep 4, 2014
7160ff1
Just return a mutable array.
tiennou Sep 4, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Classes/Categories/NSError+Git.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,4 +68,22 @@ extern NSString * const GTGitErrorDomain;
/// Returns a non-nil NSError.
+ (NSError *)git_errorFor:(int)code description:(NSString *)desc, ... NS_FORMAT_FUNCTION(2, 3);


/// Describes the given libgit2 error code, using `desc` as the error's
/// description, and a failure reason from `reason` and the arguments that
/// follow.
///
/// The created error will also have an `NSUnderlyingErrorKey` that contains the
/// result of +git_errorFor: on the same error code.
///
/// code - The error code returned from libgit2.
/// desc - The description to use in the created NSError. This may be nil.
/// userInfo - A dictionary of additional values to insert in the NSError userInfo.
/// This may be nil.
/// reason - A format string to use for the created NSError's failure reason.
/// This may be nil.
/// ... - Format arguments to insert into `reason`.
///
/// Returns a non-nil NSError.
+ (NSError *)git_errorFor:(int)code description:(NSString *)desc userInfo:(NSDictionary *)userInfo failureReason:(NSString *)reason, ... NS_FORMAT_FUNCTION(4, 5);
@end
20 changes: 20 additions & 0 deletions Classes/Categories/NSError+Git.m
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,26 @@ + (NSError *)git_errorFor:(int)code description:(NSString *)desc failureReason:(
return [NSError errorWithDomain:GTGitErrorDomain code:code userInfo:userInfo];
}

+ (NSError *)git_errorFor:(int)code description:(NSString *)desc userInfo:(NSDictionary *)additionalUserInfo failureReason:(NSString *)reason, ... {
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithDictionary:additionalUserInfo];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can use -mutableCopy.

Copy link
Contributor Author

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 😧.


if (desc != nil) userInfo[NSLocalizedDescriptionKey] = desc;
if (reason != nil) {
va_list args;
va_start(args, reason);

NSString *formattedReason = [[NSString alloc] initWithFormat:reason arguments:args];
va_end(args);

userInfo[NSLocalizedFailureReasonErrorKey] = formattedReason;
}

NSError *underError = [self git_errorFor:code];
if (underError != nil) userInfo[NSUnderlyingErrorKey] = underError;

return [NSError errorWithDomain:GTGitErrorDomain code:code userInfo:userInfo];
}

+ (NSError *)git_errorFor:(int)code {
NSDictionary *userInfo = nil;

Expand Down
1 change: 1 addition & 0 deletions Classes/GTBranch.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

@class GTCommit;
@class GTReference;
@class GTRemote;
@class GTRepository;

typedef NS_ENUM(NSInteger, GTBranchType) {
Expand Down
1 change: 1 addition & 0 deletions Classes/GTBranch.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#import "GTEnumerator.h"
#import "GTRepository.h"
#import "GTCommit.h"
#import "GTRemote.h"
#import "NSError+Git.h"

@implementation GTBranch
Expand Down
2 changes: 1 addition & 1 deletion Classes/GTConfiguration.m
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ - (NSArray *)remotes {
git_remote *remote = NULL;

if (git_remote_load(&remote, repository.git_repository, name) == 0) {
[remotes addObject:[[GTRemote alloc] initWithGitRemote:remote]];
[remotes addObject:[[GTRemote alloc] initWithGitRemote:remote inRepository:repository]];
}
}

Expand Down
38 changes: 38 additions & 0 deletions Classes/GTFetchHeadEntry.h
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
36 changes: 36 additions & 0 deletions Classes/GTFetchHeadEntry.m
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
91 changes: 83 additions & 8 deletions Classes/GTRemote.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,106 @@

#import "git2.h"

@class GTRepository;
@class GTOID;
@class GTReference;
@class GTCredentialProvider;

extern NSString * const GTRemoteRenameProblematicRefSpecs;

// Auto Tag settings. See `git_remote_autotag_option_t`.
typedef enum {
GTRemoteDownloadTagsAuto = GIT_REMOTE_DOWNLOAD_TAGS_AUTO,
GTRemoteDownloadTagsNone = GIT_REMOTE_DOWNLOAD_TAGS_NONE,
GTRemoteDownloadTagsAll = GIT_REMOTE_DOWNLOAD_TAGS_ALL,
} GTRemoteAutoTagOption;

/// A class representing a remote for a git repository.
///
/// Analagous to `git_remote` in libgit2.
/// Analogous to `git_remote` in libgit2.
@interface GTRemote : NSObject

/// Initializes a new GTRemote to represent an underlying `git_remote`.
///
/// remote - The underlying `git_remote` object.
- (id)initWithGitRemote:(git_remote *)remote;

/// The underlying `git_remote` object.
- (git_remote *)git_remote __attribute__((objc_returns_inner_pointer));
/// The repository owning this remote.
@property (nonatomic, readonly, strong) GTRepository *repository;

/// The name of the remote.
@property (nonatomic, readonly, copy) NSString *name;

/// The URL string for the remote.
@property (nonatomic, readonly, copy) NSString *URLString;

/// The push URL for the remote, if provided.
@property (nonatomic, copy) NSString *pushURLString;

/// Whether the remote is connected or not.
@property (nonatomic, readonly, getter=isConnected) BOOL connected;

/// Whether the remote updates FETCH_HEAD when fetched.
/// Defaults to YES.
@property (nonatomic) BOOL updatesFetchHead;

/// The auto-tag setting for the remote.
@property (nonatomic) GTRemoteAutoTagOption autoTag;

/// The fetch refspecs for this remote.
///
/// This array will contain NSStrings of the form
/// `+refs/heads/*:refs/remotes/REMOTE/*`.
@property (nonatomic, readonly, copy) NSArray *fetchRefspecs;

/// The push refspecs for this remote.
///
/// This array will contain NSStrings of the form
/// `+refs/heads/*:refs/remotes/REMOTE/*`.
@property (nonatomic, readonly, copy) NSArray *pushRefspecs;

/// Tests if a URL is supported (e.g. it's a supported URL scheme)
+ (BOOL)isSupportedURLString:(NSString *)URLString;

/// Tests if a URL is valid (e.g. it actually makes sense as a URL)
+ (BOOL)isValidURLString:(NSString *)URLString;

/// Tests if a name is valid
+ (BOOL)isValidRemoteName:(NSString *)name;

/// Create a new remote in a repository.
///
/// name - The name for the new remote. Cannot be nil.
/// URLString - The origin URL for the remote. Cannot be nil.
/// repo - The repository the remote should be created in. Cannot be nil.
/// error - Will be set if an error occurs.
///
/// Returns a new remote, or nil if an error occurred
+ (instancetype)createRemoteWithName:(NSString *)name URLString:(NSString *)URLString inRepository:(GTRepository *)repo error:(NSError **)error;

/// Load a remote from a repository.
///
/// name - The name for the new remote. Cannot be nil.
/// repo - The repository the remote should be looked up in. Cannot be nil.
/// error - Will be set if an error occurs.
///
/// Returns the loaded remote, or nil if an error occurred.
+ (instancetype)remoteWithName:(NSString *)name inRepository:(GTRepository *)repo error:(NSError **)error;

/// Initialize a remote from a `git_remote`.
///
/// remote - The underlying `git_remote` object. Cannot be nil.
/// repo - The repository the remote belongs to. Cannot be nil.
- (instancetype)initWithGitRemote:(git_remote *)remote inRepository:(GTRepository *)repo;

/// The underlying `git_remote` object.
- (git_remote *)git_remote __attribute__((objc_returns_inner_pointer));

/// Rename the remote.
///
/// name - The new name for the remote. Cannot be nil.
/// error - Will be set if an error occurs. If there was an error renaming some
/// refspecs, their names will be available as an arry under the
/// `GTRemoteRenameProblematicRefSpecs` key.
///
/// Return YES if successful, NO otherwise.
- (BOOL)rename:(NSString *)name error:(NSError **)error;

/// Updates the URL string for this remote.
///
/// URLString - The URLString to update to. May not be nil.
Expand Down
Loading