Add merge conflicted files to user info by pietbrauer · Pull Request #550 · libgit2/objective-git

Expand Up @@ -20,6 +20,8 @@ #import "GTIndexEntry.h" #import "git2/errors.h"
NSString * const GTPullMergeConflictedFiles = @"GTPullMergeConflictedFiles";

Choose a reason for hiding this comment

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

We should expose this from the header too, so users don't have to know the string literal.


@implementation GTRepository (Pull)
#pragma mark - Pull Expand Down Expand Up @@ -112,11 +114,8 @@ - (BOOL)pullBranch:(GTBranch *)branch fromRemote:(GTRemote *)remote withOptions: [files addObject:ours.path]; }]; if (error != NULL) { if (files.count > 0) { *error = [NSError git_errorFor:GIT_ECONFLICT description:@"Merge conflict in files: %@. Pull aborted.", [files componentsJoinedByString:@", "]]; } else { *error = [NSError git_errorFor:GIT_ECONFLICT description:@"Merge conflict, pull aborted"]; } NSDictionary *userInfo = @{GTPullMergeConflictedFiles: files}; *error = [NSError git_errorFor:GIT_ECONFLICT description:@"Merge conflict, Pull aborted." userInfo:userInfo failureReason:nil]; } return NO; } Expand Down