Skip to content

Commit ef6d136

Browse files
committed
Add indexURL to PBGitRepository
1 parent 42150f7 commit ef6d136

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

PBGitRepository.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) {
128128
- (id) initWithURL: (NSURL*) path;
129129
- (void) setup;
130130
- (void) forceUpdateRevisions;
131+
- (NSURL*) getIndexURL;
131132

132133
// for the scripting bridge
133134
- (void)findInModeScriptCommand:(NSScriptCommand *)command;
@@ -141,5 +142,6 @@ static NSString * PBStringFromBranchFilterType(PBGitXBranchFilterType type) {
141142
@property (assign) PBGitRevSpecifier *currentBranch;
142143
@property (assign) NSInteger currentBranchFilter;
143144
@property (retain) NSMutableDictionary* refs;
145+
@property (readonly, getter = getIndexURL) NSURL* indexURL;
144146

145147
@end

PBGitRepository.m

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1127,6 +1127,13 @@ - (NSString*) parseSymbolicReference:(NSString*) reference
11271127
return nil;
11281128
}
11291129

1130+
- (NSURL*) getIndexURL
1131+
{
1132+
GTRepository* gtRepo = [[GTRepository repositoryWithURL:self.fileURL error:nil] autorelease];
1133+
NSString* indexPath = [NSString stringWithUTF8String:git_repository_path(gtRepo.repo, GIT_REPO_PATH_INDEX)];
1134+
NSURL* indexURL = [NSURL fileURLWithPath:indexPath];
1135+
return [indexURL autorelease];
1136+
}
11301137
- (void) finalize
11311138
{
11321139
NSLog(@"Dealloc of repository");

0 commit comments

Comments
 (0)