Skip to content

Commit f7a846e

Browse files
committed
Add similarity accessor to diff deltas
1 parent c9566e2 commit f7a846e

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

ObjectiveGit/GTDiffDelta.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ NS_ASSUME_NONNULL_BEGIN
7373
/// Think "status" as in `git status`.
7474
@property (nonatomic, readonly) GTDeltaType type;
7575

76+
@property (nonatomic, readonly, assign) double similarity;
77+
7678
/// Diffs the given blob and data buffer.
7779
///
7880
/// oldBlob - The blob which should comprise the left side of the diff. May be

ObjectiveGit/GTDiffDelta.m

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,9 @@ - (GTDiffFile *)newFile {
5959
- (GTDeltaType)type {
6060
return (GTDeltaType)self.git_diff_delta.status;
6161
}
62+
63+
- (double)similarity {
64+
return (double)(self.git_diff_delta.similarity / 100.0);
6265
}
6366

6467
#pragma mark Lifecycle

0 commit comments

Comments
 (0)