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 29
29
30
30
#import < Foundation/Foundation.h>
31
31
32
+ // / The error domain used by Objective-Git
32
33
extern NSString * const GTGitErrorDomain;
33
34
35
+ // / Error userinfo keys
36
+ extern NSString * const GTGitErrorOID;
37
+
34
38
@interface NSError (Git)
35
39
36
40
// / Describes the given libgit2 error code, using any message provided by
Original file line number Diff line number Diff line change 31
31
#import " git2/errors.h"
32
32
33
33
NSString * const GTGitErrorDomain = @" GTGitErrorDomain" ;
34
+ NSString * const GTGitErrorOID = @" GTOID" ;
34
35
35
36
@implementation NSError (Git)
36
37
Original file line number Diff line number Diff line change @@ -290,7 +290,10 @@ - (id)lookUpObjectByGitOid:(const git_oid *)oid objectType:(GTObjectType)type er
290
290
if (error != NULL ) {
291
291
char oid_str[GIT_OID_HEXSZ+1 ];
292
292
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];
294
297
}
295
298
return nil ;
296
299
}
You can’t perform that action at this time.
0 commit comments