forked from laullon/gitx
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPBGitRepository.h
175 lines (147 loc) · 6.35 KB
/
PBGitRepository.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
//
// PBGitRepository.h
// GitTest
//
// Created by Pieter de Bie on 13-06-08.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import <Cocoa/Cocoa.h>
#import "PBGitHistoryList.h"
#import "PBGitRevSpecifier.h"
#import "PBGitConfig.h"
#import "PBGitRefish.h"
extern NSString* PBGitRepositoryErrorDomain;
typedef enum branchFilterTypes {
kGitXAllBranchesFilter = 0,
kGitXLocalRemoteBranchesFilter,
kGitXSelectedBranchFilter
} PBGitXBranchFilterType;
static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) {
switch (type) {
case kGitXAllBranchesFilter:
return @"All";
break;
case kGitXLocalRemoteBranchesFilter:
return @"Local";
break;
case kGitXSelectedBranchFilter:
return @"Selected";
break;
default:
break;
}
return @"Not a branch filter type";
}
@class PBGitWindowController;
@class PBGitCommit;
@class PBGitResetController;
@class PBStashController;
@class PBSubmoduleController;
dispatch_queue_t PBGetWorkQueue();
@interface PBGitRepository : NSDocument {
PBGitHistoryList* revisionList;
PBGitConfig *config;
BOOL hasChanged;
NSInteger currentBranchFilter;
NSMutableDictionary *refs;
PBGitRevSpecifier *_headRef; // Caching
NSString* _headSha;
PBStashController *stashController;
PBSubmoduleController *submoduleController;
PBGitResetController *resetController;
BOOL didCheckBareRepository;
BOOL bareRepository;
NSString* workingDirectory;
}
@property (nonatomic, strong, readonly) PBStashController *stashController;
@property (nonatomic, strong, readonly) PBSubmoduleController *submoduleController;
@property (nonatomic, strong, readonly) PBGitResetController *resetController;
- (void) cloneRepositoryToPath:(NSString *)path bare:(BOOL)isBare;
- (void) beginAddRemote:(NSString *)remoteName forURL:(NSString *)remoteURL;
- (void) beginFetchFromRemoteForRef:(PBGitRef *)ref;
- (void) beginPullFromRemote:(PBGitRef *)remoteRef forRef:(PBGitRef *)ref;
- (void) beginPushRef:(PBGitRef *)ref toRemote:(PBGitRef *)remoteRef;
- (BOOL) checkoutRefish:(id <PBGitRefish>)ref;
- (BOOL) checkoutFiles:(NSArray *)files fromRefish:(id <PBGitRefish>)ref;
- (BOOL) mergeWithRefish:(id <PBGitRefish>)ref;
- (BOOL) cherryPickRefish:(id <PBGitRefish>)ref;
- (BOOL) rebaseBranch:(id <PBGitRefish>)branch onRefish:(id <PBGitRefish>)upstream;
- (BOOL) renameRef:(PBGitRef*)ref withNewName:(NSString *)newName;
- (BOOL) createBranch:(NSString *)branchName atRefish:(id <PBGitRefish>)ref;
- (BOOL) createTag:(NSString *)tagName message:(NSString *)message atRefish:(id <PBGitRefish>)commitSHA force:(BOOL)force;
- (BOOL) deleteRemote:(PBGitRef *)ref;
- (BOOL) isRemoteConnected:(NSString*)remoteName;
- (BOOL) deleteRemoteBranch:(PBGitRef *)ref;
- (BOOL) deleteRemoteTag:(PBGitRef *)ref;
- (BOOL) deleteRef:(PBGitRef *)ref;
- (BOOL) hasSvnRemote;
- (NSArray*) svnRemotes;
- (BOOL) svnFetch:(NSString*)remoteName;
- (BOOL) svnRebase:(NSString*)remoteName;
- (BOOL) svnDcommit:(NSString*)commitURL;
- (NSFileHandle*) handleForCommand:(NSString*) cmd;
- (NSFileHandle*) handleForArguments:(NSArray*) args;
- (NSFileHandle*) handleInWorkDirForArguments:(NSArray *)args;
- (NSFileHandle *) handleInWorkDirForArguments:(NSArray *)args;
- (NSString*) outputForCommand:(NSString*) cmd;
- (NSString *)outputForCommand:(NSString *)str retValue:(int *)ret;
- (NSString *)outputForArguments:(NSArray *)arguments inputString:(NSString *)input retValue:(int *)ret;
- (NSString *)outputForArguments:(NSArray *)arguments inputString:(NSString *)input byExtendingEnvironment:(NSDictionary *)dict retValue:(int *)ret;
- (NSString*) outputForArguments:(NSArray*) args;
- (NSString*) outputForArguments:(NSArray*) args retValue:(int *)ret;
- (NSString *)outputInWorkdirForArguments:(NSArray*) arguments;
- (NSString *)outputInWorkdirForArguments:(NSArray*) arguments retValue:(int *)ret;
- (BOOL)executeHook:(NSString *)name output:(NSString **)output;
- (BOOL)executeHook:(NSString *)name withArgs:(NSArray*) arguments output:(NSString **)output;
- (NSString *)workingDirectory;
- (NSString *) projectName;
- (NSString *)gitIgnoreFilename;
- (BOOL)isBareRepository;
- (void) reloadRefs;
- (void) addRef:(PBGitRef *)ref fromParameters:(NSArray *)params;
- (void) lazyReload;
- (PBGitRevSpecifier*)headRef;
- (NSString *)headSHA;
- (PBGitCommit *)headCommit;
- (NSString *)shaForRef:(PBGitRef *)ref;
- (PBGitCommit *)commitForRef:(PBGitRef *)ref;
- (PBGitCommit *)commitForSHA:(NSString *)sha;
- (BOOL)isOnSameBranch:(NSString *)baseSHA asSHA:(NSString *)testSHA;
- (BOOL)isSHAOnHeadBranch:(NSString *)testSHA;
- (BOOL)isRefOnHeadBranch:(PBGitRef *)testRef;
- (BOOL)checkRefFormat:(NSString *)refName;
- (BOOL)refExists:(PBGitRef *)ref checkOnRemotesWithoutBranches:(BOOL)remoteCheck resultMessage:(NSString**)result;
- (BOOL)refExistsOnRemote:(PBGitRef*)ref remoteName:(NSString*)remote resultMessage:(NSString**)result;
- (BOOL)refExistsOnAnyRemote:(PBGitRef*)ref resultMessage:(NSString**)result;
- (BOOL)tagExistsOnRemote:(PBGitRef *)ref remoteName:(NSString *)remote;
- (PBGitRef *)refForName:(NSString *)name;
- (NSArray *) remotes;
- (BOOL) hasRemotes;
- (PBGitRef *) remoteRefForBranch:(PBGitRef *)branch error:(NSError **)error;
- (NSString *) infoForRemote:(NSString *)remoteName;
- (NSArray*) URLsForRemote:(NSString*)remoteName;
- (void) readCurrentBranch;
- (PBGitRevSpecifier*) addBranch: (PBGitRevSpecifier*) rev;
- (BOOL)removeBranch:(PBGitRevSpecifier *)rev;
- (NSString*) parseSymbolicReference:(NSString*) ref;
- (NSString*) parseReference:(NSString*) ref;
+ (NSURL*)gitDirForURL:(NSURL*)repositoryURL;
+ (NSURL*)baseDirForURL:(NSURL*)repositoryURL;
- (id) initWithURL: (NSURL*) path;
- (void) setup;
- (void) forceUpdateRevisions;
// for the scripting bridge
- (void)findInModeScriptCommand:(NSScriptCommand *)command;
- (NSMenu *) menu;
+(bool)isLocalBranch:(NSString *)branch branchNameInto:(NSString **)name;
- (NSString*) remoteUrl:(NSString*)remoteName;
- (void) changeRemote:(PBGitRef *)ref toURL:(NSURL*)newUrl;
@property (assign) BOOL hasChanged;
@property (readonly) PBGitWindowController *windowController;
@property (readonly) PBGitConfig *config;
@property (strong) PBGitHistoryList *revisionList;
@property (strong) NSMutableArray* branches;
@property (strong) PBGitRevSpecifier *currentBranch;
@property (assign) NSInteger currentBranchFilter;
@property (strong) NSMutableDictionary* refs;
@end