Skip to content

Commit 5c20a8c

Browse files
committed
Reverse order of commits when copying a selection
The array we receive is top-to-bottom in the on-screen list, i.e. new-to-old in the git history which seems to be the wrong way round.
1 parent 50ab5de commit 5c20a8c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Classes/Util/GitXCommitCopier.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ + (NSString *) toPatch:(NSArray<PBGitCommit *> *)commits {
5555
+ (NSArray<NSString *> *) transformCommits:(NSArray<PBGitCommit *> *)commits with:(NSString *(^)(PBGitCommit * commit))transformer {
5656

5757
NSMutableArray *strings = [NSMutableArray arrayWithCapacity:commits.count];
58-
[commits enumerateObjectsUsingBlock:^(PBGitCommit * _Nonnull commit, NSUInteger idx, BOOL * _Nonnull stop) {
58+
[commits enumerateObjectsWithOptions:NSEnumerationReverse usingBlock:^(PBGitCommit * _Nonnull commit, NSUInteger idx, BOOL * _Nonnull stop) {
5959
[strings addObject:transformer(commit)];
6060
}];
6161

0 commit comments

Comments
 (0)