Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Naming naming is no fun.
  • Loading branch information
joshaber committed Jun 26, 2015
commit fde315948e12722db90ac27733fdabf8cf5eed05
2 changes: 1 addition & 1 deletion ObjectiveGit/GTBranch.m
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ - (GTBranchType)branchType {
}

- (NSArray *)uniqueCommitsRelativeToBranch:(GTBranch *)otherBranch error:(NSError **)error {
GTEnumerator *enumerator = [self.repository enumeratorForCommitsStartingAtOID:self.OID endingAtOID:otherBranch.OID error:error];
GTEnumerator *enumerator = [self.repository enumeratorForUniqueCommitsFromOID:self.OID relativeToOID:otherBranch.OID error:error];
return [enumerator allObjectsWithError:error];
}

Expand Down
10 changes: 5 additions & 5 deletions ObjectiveGit/GTRepository.h
Original file line number Diff line number Diff line change
Expand Up @@ -555,15 +555,15 @@ NS_ASSUME_NONNULL_BEGIN
/// Returns whether `ahead` and `behind` were successfully calculated.
- (BOOL)calculateAhead:(size_t *)ahead behind:(size_t *)behind ofOID:(GTOID *)headOID relativeToOID:(GTOID *)baseOID error:(NSError **)error;

/// Creates an enumerator for walking the local commits beginning at one OID and
/// ending at another. It will *not* include the commit for `endingOID`.
/// Creates an enumerator for walking the unique commits, as determined by a
/// pushing a starting OID and hiding the relative OID.
///
/// startingOID - The starting OID.
/// endingOID - The ending OID.
/// fromOID - The starting OID.
/// relativeOID - The OID to hide.
/// error - The error if one occurred.
///
/// Returns the enumerator or nil if an error occurred.
- (nullable GTEnumerator *)enumeratorForCommitsStartingAtOID:(GTOID *)startingOID endingAtOID:(GTOID *)endingOID error:(NSError **)error;
- (nullable GTEnumerator *)enumeratorForUniqueCommitsFromOID:(GTOID *)fromOID relativeToOID:(GTOID *)relativeOID error:(NSError **)error;

@end

Expand Down
10 changes: 5 additions & 5 deletions ObjectiveGit/GTRepository.m
Original file line number Diff line number Diff line change
Expand Up @@ -894,17 +894,17 @@ - (BOOL)calculateAhead:(size_t *)ahead behind:(size_t *)behind ofOID:(GTOID *)he
return YES;
}

- (nullable GTEnumerator *)enumeratorForCommitsStartingAtOID:(GTOID *)startingOID endingAtOID:(GTOID *)endingOID error:(NSError **)error {
NSParameterAssert(startingOID != nil);
NSParameterAssert(endingOID != nil);
- (nullable GTEnumerator *)enumeratorForUniqueCommitsFromOID:(GTOID *)fromOID relativeToOID:(GTOID *)relativeOID error:(NSError **)error {
NSParameterAssert(fromOID != nil);
NSParameterAssert(relativeOID != nil);

GTEnumerator *enumerator = [[GTEnumerator alloc] initWithRepository:self error:error];
if (enumerator == nil) return nil;

BOOL success = [enumerator pushSHA:startingOID.SHA error:error];
BOOL success = [enumerator pushSHA:fromOID.SHA error:error];
if (!success) return nil;

success = [enumerator hideSHA:endingOID.SHA error:error];
success = [enumerator hideSHA:relativeOID.SHA error:error];
if (!success) return nil;

return enumerator;
Expand Down