Skip to content

Commit

Permalink
Add similarity accessor to diff deltas
Browse files Browse the repository at this point in the history
  • Loading branch information
tiennou committed Aug 3, 2016
1 parent 5e77065 commit fa21ded
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ObjectiveGit/GTDiffDelta.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ NS_ASSUME_NONNULL_BEGIN
/// Think "status" as in `git status`.
@property (nonatomic, readonly) GTDeltaType type;

@property (nonatomic, readonly, assign) double similarity;

/// Diffs the given blob and data buffer.
///
/// oldBlob - The blob which should comprise the left side of the diff. May be
Expand Down
3 changes: 3 additions & 0 deletions ObjectiveGit/GTDiffDelta.m
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ - (GTDiffFile *)newFile {
- (GTDeltaType)type {
return (GTDeltaType)self.git_diff_delta.status;
}

- (double)similarity {
return (double)(self.git_diff_delta.similarity / 100.0);
}

#pragma mark Lifecycle
Expand Down

0 comments on commit fa21ded

Please sign in to comment.