File tree Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Expand file tree Collapse file tree 3 files changed +9
-1
lines changed Original file line number Diff line number Diff line change 2929
3030#import < Foundation/Foundation.h>
3131
32+ // / The error domain used by Objective-Git
3233extern NSString * const GTGitErrorDomain;
3334
35+ // / Error userinfo keys
36+ extern NSString * const GTGitErrorOID;
37+
3438@interface NSError (Git)
3539
3640// / Describes the given libgit2 error code, using any message provided by
Original file line number Diff line number Diff line change 3131#import " git2/errors.h"
3232
3333NSString * const GTGitErrorDomain = @" GTGitErrorDomain" ;
34+ NSString * const GTGitErrorOID = @" GTOID" ;
3435
3536@implementation NSError (Git)
3637
Original file line number Diff line number Diff line change @@ -290,7 +290,10 @@ - (id)lookUpObjectByGitOid:(const git_oid *)oid objectType:(GTObjectType)type er
290290 if (error != NULL ) {
291291 char oid_str[GIT_OID_HEXSZ+1 ];
292292 git_oid_tostr (oid_str, sizeof (oid_str), oid);
293- *error = [NSError git_errorFor: gitError description: @" Failed to lookup object %s in repository." , oid_str];
293+ *error = [NSError git_errorFor: gitError
294+ description: @" Failed to lookup object"
295+ userInfo: @{GTGitErrorOID: [GTOID oidWithGitOid: oid]}
296+ failureReason: @" The object %s couldn't be found in the repository." , oid_str];
294297 }
295298 return nil ;
296299 }
You can’t perform that action at this time.
0 commit comments