Repository navigation
Expand file tree
/
Copy pathGTStatusDelta.h
More file actions
57 lines (44 loc) · 1.81 KB
/
Copy pathGTStatusDelta.h
File metadata and controls
57 lines (44 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// GTStatusDelta.h
// ObjectiveGitFramework
//
// Created by Danny Greg on 08/08/2013.
// Copyright (c) 2013 GitHub, Inc. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <git2/diff.h>
@class GTDiffFile;
/// An enum representing the status of the file.
///
/// See diff.h for documentation of individual flags.
typedef NS_ENUM(NSInteger, GTStatusDeltaStatus) {
GTStatusDeltaStatusUnmodified = GIT_DELTA_UNMODIFIED,
GTStatusDeltaStatusAdded = GIT_DELTA_ADDED,
GTStatusDeltaStatusDeleted = GIT_DELTA_DELETED,
GTStatusDeltaStatusModified = GIT_DELTA_MODIFIED,
GTStatusDeltaStatusRenamed = GIT_DELTA_RENAMED,
GTStatusDeltaStatusCopied = GIT_DELTA_COPIED,
GTStatusDeltaStatusIgnored = GIT_DELTA_IGNORED,
GTStatusDeltaStatusUntracked = GIT_DELTA_UNTRACKED,
GTStatusDeltaStatusTypeChange = GIT_DELTA_TYPECHANGE,
};
NS_ASSUME_NONNULL_BEGIN
/// Represents the status of a file in a repository.
@interface GTStatusDelta : NSObject
/// The file as it was prior to the change represented by this status delta.
@property (nonatomic, readonly, copy, nullable) GTDiffFile *oldFile;
/// The file after the change represented by this status delta
@property (nonatomic, readonly, copy, nullable) GTDiffFile *newFile __attribute__((ns_returns_not_retained));
/// The status of the file.
@property (nonatomic, readonly) GTStatusDeltaStatus status;
/// A float between 0 and 1 describing how similar the old and new
/// files are (where 0 is not at all and 1 is identical).
///
/// Only useful when the status is `GTStatusDeltaStatusRenamed` or
/// `GTStatusDeltaStatusCopied`.
@property (nonatomic, readonly) double similarity;
- (instancetype)init NS_UNAVAILABLE;
/// Designated initializer.
- (nullable instancetype)initWithGitDiffDelta:(const git_diff_delta *)delta NS_DESIGNATED_INITIALIZER;
@end
NS_ASSUME_NONNULL_END