File tree Expand file tree Collapse file tree 4 files changed +23
-0
lines changed Expand file tree Collapse file tree 4 files changed +23
-0
lines changed Original file line number Diff line number Diff line change 10
10
11
11
@class PBGitRepository;
12
12
@class PBGitRevSpecifier;
13
+ @class PBGitWindowController;
13
14
14
15
extern NSString *PBGitRepositoryDocumentType;
15
16
@@ -30,4 +31,6 @@ extern NSString *PBGitRepositoryDocumentType;
30
31
31
32
- (void )selectRevisionSpecifier : (PBGitRevSpecifier *)specifier ;
32
33
34
+ - (PBGitWindowController *)windowController ;
35
+
33
36
@end
Original file line number Diff line number Diff line change @@ -54,6 +54,8 @@ - (BOOL)readFromURL:(NSURL *)absoluteURL ofType:(NSString *)typeName error:(NSEr
54
54
if (!_repository)
55
55
return NO ;
56
56
57
+ [_repository setDocument: self ];
58
+
57
59
return YES ;
58
60
}
59
61
Original file line number Diff line number Diff line change @@ -70,6 +70,8 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) {
70
70
// Designated initializer
71
71
- (id )initWithURL : (NSURL *)repositoryURL error : (NSError **)error ;
72
72
73
+ - (void )setDocument : (NSDocument *)document ; // Backward-compatibility while PBGitRepository gets "modelized";
74
+
73
75
- (void ) cloneRepositoryToPath : (NSString *)path bare : (BOOL )isBare ;
74
76
- (void ) beginAddRemote : (NSString *)remoteName forURL : (NSString *)remoteURL ;
75
77
- (void ) beginFetchFromRemoteForRef : (PBGitRef *)ref ;
Original file line number Diff line number Diff line change 10
10
#import " PBGitCommit.h"
11
11
#import " PBGitIndex.h"
12
12
#import " PBGitWindowController.h"
13
+ #import " PBGitRepositoryDocument.h"
13
14
#import " PBGitBinary.h"
14
15
15
16
#import " NSFileHandleExt.h"
@@ -32,6 +33,8 @@ @interface PBGitRepository () {
32
33
__strong GTOID* _headOID;
33
34
__strong GTRepository* _gtRepo;
34
35
PBGitIndex *_index;
36
+
37
+ PBGitRepositoryDocument *_document;
35
38
}
36
39
37
40
@property (nonatomic , strong ) NSNumber *hasSVNRepoConfig;
@@ -92,6 +95,19 @@ - (void) dealloc
92
95
[watcher stop ];
93
96
}
94
97
98
+ #pragma mark -
99
+ #pragma mark Backward-compatibility
100
+ // PBGitRepository is responsible for both repository actions and document management
101
+ // This is here for the time being while the controller code gets updated to use PBGitRepositoryDocument.
102
+
103
+ - (void )setDocument : (NSDocument *)document {
104
+ _document = (PBGitRepositoryDocument *)document;
105
+ }
106
+
107
+ - (PBGitWindowController *)windowController {
108
+ return _document.windowController ;
109
+ }
110
+
95
111
#pragma mark -
96
112
#pragma mark Properties/General methods
97
113
You can’t perform that action at this time.
0 commit comments