-
Notifications
You must be signed in to change notification settings - Fork 280
/
GTRepository+Reset.h
44 lines (35 loc) · 1.32 KB
/
GTRepository+Reset.h
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
//
// GTRepository+Reset.h
// ObjectiveGitFramework
//
// Created by Josh Abernathy on 4/4/14.
// Copyright (c) 2014 GitHub, Inc. All rights reserved.
//
#import "GTRepository.h"
#import "git2/reset.h"
/// The reset types. See the libgit2 documentation for more info.
typedef NS_ENUM(NSInteger, GTRepositoryResetType) {
GTRepositoryResetTypeSoft = GIT_RESET_SOFT,
GTRepositoryResetTypeMixed = GIT_RESET_MIXED,
GTRepositoryResetTypeHard = GIT_RESET_HARD,
};
NS_ASSUME_NONNULL_BEGIN
@interface GTRepository (Reset)
/// Reset the repository's HEAD to the given commit.
///
/// commit - The commit the HEAD is to be reset to. Must not be nil.
/// resetType - The type of reset to be used.
/// error - The error if one occurred.
///
/// Returns whether the reset was succcessful.
- (BOOL)resetToCommit:(GTCommit *)commit resetType:(GTRepositoryResetType)resetType error:(NSError **)error;
/// Resets the given pathspecs in the index to the tree entries from the commit.
///
/// pathspecs - The pathspecs to reset. Cannot be nil.
/// commit - The commit whose tree should be used to reset. Cannot be nil.
/// error - The error if one occurred.
///
/// Returns whether the reset was successful.
- (BOOL)resetPathspecs:(NSArray<NSString *> *)pathspecs toCommit:(GTCommit *)commit error:(NSError **)error;
@end
NS_ASSUME_NONNULL_END