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"
12 #import "PBGitConfig.h"
14 extern NSString
* PBGitRepositoryErrorDomain
;
16 @interface PBGitRepository
: NSDocument
{
17 PBGitRevList
* revisionList
;
21 NSMutableArray
*branches
;
22 PBGitRevSpecifier
*currentBranch
;
23 NSMutableDictionary
*refs
;
25 PBGitRevSpecifier
*_headRef
; // Caching
28 - (NSFileHandle
*) handleForCommand
:(NSString
*) cmd
;
29 - (NSFileHandle
*) handleForArguments
:(NSArray
*) args
;
30 - (NSFileHandle
*) handleInWorkDirForArguments
:(NSArray
*)args
;
31 - (NSString
*) outputForCommand
:(NSString
*) cmd
;
32 - (NSString
*)outputForCommand
:(NSString
*)str retValue
:(int *)ret
;
33 - (NSString
*)outputForArguments
:(NSArray
*)arguments inputString
:(NSString
*)input retValue
:(int *)ret
;
34 - (NSString
*) outputForArguments
:(NSArray
*) args
;
35 - (NSString
*) outputForArguments
:(NSArray
*) args retValue
:(int *)ret
;
36 - (NSString
*)outputInWorkdirForArguments
:(NSArray
*) arguments
;
37 - (NSString
*)outputInWorkdirForArguments
:(NSArray
*) arguments retValue
:(int *)ret
;
39 - (NSString
*)workingDirectory
;
40 - (NSString
*)gitIgnoreFilename
;
43 - (void) addRef
:(PBGitRef
*)ref fromParameters
:(NSArray
*)params
;
45 - (PBGitRevSpecifier
*) headRef
;
47 - (void) readCurrentBranch
;
48 - (PBGitRevSpecifier
*) addBranch
: (PBGitRevSpecifier
*) rev
;
50 - (NSString
*) parseSymbolicReference
:(NSString
*) ref
;
51 - (NSString
*) parseReference
:(NSString
*) ref
;
53 + (NSURL
*)gitDirForURL
:(NSURL
*)repositoryURL
;
54 + (NSURL
*)baseDirForURL
:(NSURL
*)repositoryURL
;
56 - (id
) initWithURL
: (NSURL
*) path
;
59 @
property (assign
) BOOL hasChanged
;
60 @
property (readonly
) NSWindowController
*windowController
;
61 @
property (readonly
) PBGitConfig
*config
;
62 @
property (retain
) PBGitRevList
* revisionList
;
63 @
property (assign
) NSMutableArray
* branches
;
64 @
property (assign
) PBGitRevSpecifier
*currentBranch
;
65 @
property (retain
) NSMutableDictionary
* refs
;