Skip to content
Merged
Prev Previous commit
Next Next commit
GTRepository typed collections
  • Loading branch information
JrGoodle committed Sep 19, 2015
commit 3fd3b21a73ce22cf6d68a3de19e329a6f8e8a353
4 changes: 2 additions & 2 deletions ObjectiveGit/GTRepository+Committing.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ NS_ASSUME_NONNULL_BEGIN
/// error - The error if one occurred.
///
/// Returns the newly created commit, or nil if an error occurred.
- (nullable GTCommit *)createCommitWithTree:(GTTree *)tree message:(NSString *)message author:(GTSignature *)author committer:(GTSignature *)committer parents:(nullable NSArray *)parents updatingReferenceNamed:(nullable NSString *)refName error:(NSError **)error;
- (nullable GTCommit *)createCommitWithTree:(GTTree *)tree message:(NSString *)message author:(GTSignature *)author committer:(GTSignature *)committer parents:(nullable NSArray<GTCommit *> *)parents updatingReferenceNamed:(nullable NSString *)refName error:(NSError **)error;

/// Creates a new commit using +createCommitWithTree:message:author:committer:parents:updatingReferenceNamed:error:
/// with -userSignatureForNow as both the author and committer.
- (nullable GTCommit *)createCommitWithTree:(GTTree *)tree message:(NSString *)message parents:(nullable NSArray *)parents updatingReferenceNamed:(nullable NSString *)refName error:(NSError **)error;
- (nullable GTCommit *)createCommitWithTree:(GTTree *)tree message:(NSString *)message parents:(nullable NSArray<GTCommit *> *)parents updatingReferenceNamed:(nullable NSString *)refName error:(NSError **)error;

@end

Expand Down
4 changes: 2 additions & 2 deletions ObjectiveGit/GTRepository+RemoteOperations.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ extern NSString *const GTRepositoryRemoteOptionsCredentialProvider;
/// error - The error if one ocurred. Can be NULL.
///
/// Retruns a (possibly empty) array with GTFetchHeadEntry objects. Will not be nil.
- (NSArray *)fetchHeadEntriesWithError:(NSError **)error;
- (NSArray<GTFetchHeadEntry *> *)fetchHeadEntriesWithError:(NSError **)error;

#pragma mark - Push

Expand Down Expand Up @@ -78,7 +78,7 @@ extern NSString *const GTRepositoryRemoteOptionsCredentialProvider;
///
/// Returns YES if the push was successful, NO otherwise (and `error`, if provided,
/// will point to an error describing what happened).
- (BOOL)pushBranches:(NSArray *)branches toRemote:(GTRemote *)remote withOptions:(nullable NSDictionary *)options error:(NSError **)error progress:(nullable void (^)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop))progressBlock;
- (BOOL)pushBranches:(NSArray<GTBranch *> *)branches toRemote:(GTRemote *)remote withOptions:(nullable NSDictionary *)options error:(NSError **)error progress:(nullable void (^)(unsigned int current, unsigned int total, size_t bytes, BOOL *stop))progressBlock;

/// Delete a remote branch
///
Expand Down
2 changes: 1 addition & 1 deletion ObjectiveGit/GTRepository+Reset.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ NS_ASSUME_NONNULL_BEGIN
/// error - The error if one occurred.
///
/// Returns whether the reset was successful.
- (BOOL)resetPathspecs:(NSArray *)pathspecs toCommit:(GTCommit *)commit error:(NSError **)error;
- (BOOL)resetPathspecs:(NSArray<NSString *> *)pathspecs toCommit:(GTCommit *)commit error:(NSError **)error;

@end

Expand Down
16 changes: 8 additions & 8 deletions ObjectiveGit/GTRepository.h
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ extern NSString * const GTRepositoryInitOptionsOriginURLString;
///
/// returns an array of NSStrings holding the names of the references
/// returns nil if an error occurred and fills the error parameter
- (nullable NSArray *)referenceNamesWithError:(NSError **)error;
- (nullable NSArray<NSString *> *)referenceNamesWithError:(NSError **)error;

/// Get the HEAD reference.
///
Expand All @@ -274,44 +274,44 @@ extern NSString * const GTRepositoryInitOptionsOriginURLString;
/// error - If not NULL, set to any error that occurs.
///
/// Returns an array of GTBranches or nil if an error occurs.
- (nullable NSArray *)localBranchesWithError:(NSError **)error;
- (nullable NSArray<GTBranch *> *)localBranchesWithError:(NSError **)error;

/// Get the remote branches.
///
/// error - If not NULL, set to any error that occurs.
///
/// Returns an array of GTBranches or nil if an error occurs.
- (nullable NSArray *)remoteBranchesWithError:(NSError **)error;
- (nullable NSArray<GTBranch *> *)remoteBranchesWithError:(NSError **)error;

/// Get branches with names sharing a given prefix.
///
/// prefix - The prefix to use for filtering. Must not be nil.
/// error - If not NULL, set to any error that occurs.
///
/// Returns an array of GTBranches or nil if an error occurs.
- (nullable NSArray *)branchesWithPrefix:(NSString *)prefix error:(NSError **)error;
- (nullable NSArray<GTBranch *> *)branchesWithPrefix:(NSString *)prefix error:(NSError **)error;

/// Get the local and remote branches and merge them together by combining local
/// branches with their remote branch, if they have one.
///
/// error - If not NULL, set to any error that occurs.
///
/// Returns an array of GTBranches or nil if an error occurs.
- (nullable NSArray *)branches:(NSError **)error;
- (nullable NSArray<GTBranch *> *)branches:(NSError **)error;

/// List all remotes in the repository
///
/// error - will be filled if an error occurs
///
/// returns an array of NSStrings holding the names of the remotes, or nil if an error occurred
- (nullable NSArray *)remoteNamesWithError:(NSError **)error;
- (nullable NSArray<NSString *> *)remoteNamesWithError:(NSError **)error;

/// Get all tags in the repository.
///
/// error - If not NULL, set to any error that occurs.
///
/// Returns an array of GTTag or nil if an error occurs.
- (nullable NSArray *)allTagsWithError:(NSError **)error;
- (nullable NSArray<GTTag *> *)allTagsWithError:(NSError **)error;

/// Count all commits in the current branch (HEAD)
///
Expand Down Expand Up @@ -367,7 +367,7 @@ extern NSString * const GTRepositoryInitOptionsOriginURLString;
/// error(out) - will be filled if an error occurs
///
/// returns the local commits, an empty array if there is no remote branch, or nil if an error occurred
- (nullable NSArray *)localCommitsRelativeToRemoteBranch:(GTBranch *)remoteBranch error:(NSError **)error;
- (nullable NSArray<GTCommit *> *)localCommitsRelativeToRemoteBranch:(GTBranch *)remoteBranch error:(NSError **)error;

/// Retrieves git's "prepared message" for the next commit, like the default
/// message pre-filled when committing after a conflicting merge.
Expand Down