Skip to content

Commit 8bfbda0

Browse files
committed
Add an OID property to GTDiffFile.
1 parent 69ad988 commit 8bfbda0

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Classes/GTDiffFile.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ typedef enum {
1717
GTDiffFileFlagNotBinary = GIT_DIFF_FLAG_NOT_BINARY,
1818
} GTDiffFileFlag;
1919

20+
@class GTOID;
21+
2022
// A class representing a file on one side of a diff.
2123
@interface GTDiffFile : NSObject
2224

@@ -32,6 +34,9 @@ typedef enum {
3234
// The mode of the file.
3335
@property (nonatomic, readonly) mode_t mode;
3436

37+
// The OID
38+
@property (nonatomic, readonly) GTOID *OID;
39+
3540
// Designated initialiser.
3641
- (instancetype)initWithGitDiffFile:(git_diff_file)file;
3742

Classes/GTDiffFile.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
//
88

99
#import "GTDiffFile.h"
10+
#import "GTOID.h"
1011

1112
@implementation GTDiffFile
1213

@@ -18,6 +19,7 @@ - (instancetype)initWithGitDiffFile:(git_diff_file)file {
1819
_flags = (GTDiffFileFlag)file.flags;
1920
_mode = file.mode;
2021
_path = [NSString stringWithUTF8String:file.path];
22+
_OID = [[GTOID alloc] initWithGitOid:&(file.oid)];
2123

2224
return self;
2325
}

0 commit comments

Comments
 (0)