5 // Created by Pieter de Bie on 13-06-08.
6 // Copyright 2008 __MyCompanyName__. All rights reserved.
9 #import <Cocoa/Cocoa.h>
10 #import "PBGitRevList.h"
11 #import "PBGitRevSpecifier.h"
13 extern NSString
* PBGitRepositoryErrorDomain
;
15 @interface PBGitRepository
: NSDocument
{
16 PBGitRevList
* revisionList
;
19 NSMutableArray
* branches
;
20 NSIndexSet
* currentBranch
;
21 NSMutableDictionary
* refs
;
24 - (NSFileHandle
*) handleForCommand
:(NSString
*) cmd
;
25 - (NSFileHandle
*) handleForArguments
:(NSArray
*) args
;
26 - (NSFileHandle
*) handleInWorkDirForArguments
:(NSArray
*)args
;
27 - (NSString
*) outputForCommand
:(NSString
*) cmd
;
28 - (NSString
*)outputForCommand
:(NSString
*)str retValue
:(int *)ret
;
29 - (NSString
*)outputForArguments
:(NSArray
*)arguments inputString
:(NSString
*)input retValue
:(int *)ret
;
30 - (NSString
*) outputForArguments
:(NSArray
*) args
;
31 - (NSString
*) outputForArguments
:(NSArray
*) args retValue
:(int *)ret
;
32 - (NSString
*)outputInWorkdirForArguments
:(NSArray
*) arguments
;
34 - (NSString
*)workingDirectory
;
37 - (void) addRef
:(PBGitRef
*)ref fromParameters
:(NSArray
*)params
;
38 - (BOOL
) removeRef
:(NSString
*)ref
;
41 - (void) readCurrentBranch
;
42 - (PBGitRevSpecifier
*) addBranch
: (PBGitRevSpecifier
*) rev
;
43 - (void) selectBranch
: (PBGitRevSpecifier
*) rev
;
45 - (NSString
*) parseSymbolicReference
:(NSString
*) ref
;
46 - (NSString
*) parseReference
:(NSString
*) ref
;
48 + (NSURL
*)gitDirForURL
:(NSURL
*)repositoryURL
;
49 + (NSURL
*)baseDirForURL
:(NSURL
*)repositoryURL
;
51 - (id
) initWithURL
: (NSURL
*) path
;
54 @
property (assign
) BOOL hasChanged
;
55 @
property (readonly
) NSWindowController
*windowController
;
56 @
property (retain
) PBGitRevList
* revisionList
;
57 @
property (assign
) NSMutableArray
* branches
;
58 @
property (assign
) NSIndexSet
* currentBranch
;
59 @
property (assign
) NSMutableDictionary
* refs
;