mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Pass on arguments from the command line to the revwalk mechanism
This commit is contained in:
+2
-1
@@ -31,7 +31,8 @@
|
||||
// work around an apparent bug with GC and Distributed Objects
|
||||
// I am not familiar with GC though, so perhaps I was doing something wrong.
|
||||
NSURL* url = [NSURL fileURLWithPath:[repositoryPath path]];
|
||||
if (id document = [[PBRepositoryDocumentController sharedDocumentController] openDocumentWithContentsOfURL:url display:YES error:nil]) {
|
||||
NSArray* arguments = [NSArray arrayWithArray:args];
|
||||
if (id document = [[PBRepositoryDocumentController sharedDocumentController] openRepositoryAtLocation: url RevParseArgs: arguments]) {
|
||||
[NSApp activateIgnoringOtherApps:YES];
|
||||
return YES;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ extern NSString* PBGitRepositoryErrorDomain;
|
||||
+ (NSURL*)gitDirForURL:(NSURL*)repositoryURL;
|
||||
+ (NSURL*)baseDirForURL:(NSURL*)repositoryURL;
|
||||
|
||||
- (id) initWithURL: (NSURL*) path andArguments:(NSArray*) array;
|
||||
|
||||
@property (readonly) PBGitRevList* revisionList;
|
||||
@property (assign) NSArray* branches;
|
||||
@property (assign) NSString* currentBranch;
|
||||
|
||||
@@ -125,6 +125,16 @@ static NSString* gitPath;
|
||||
return success;
|
||||
}
|
||||
|
||||
- (id) initWithURL: (NSURL*) path andArguments:(NSArray*) array
|
||||
{
|
||||
self = [self init];
|
||||
NSURL* gitDirURL = [PBGitRepository gitDirForURL:path];
|
||||
[self setFileURL: gitDirURL];
|
||||
[self readRefs];
|
||||
[self readCurrentBranch];
|
||||
revisionList = [[PBGitRevList alloc] initWithRepository:self andRevListParameters:array];
|
||||
return self;
|
||||
}
|
||||
// The fileURL the document keeps is to the .git dir, but that’s pretty
|
||||
// useless for display in the window title bar, so we show the directory above
|
||||
- (NSString*)displayName
|
||||
|
||||
@@ -14,4 +14,5 @@
|
||||
|
||||
}
|
||||
|
||||
- (id) openRepositoryAtLocation:(NSURL*) url RevParseArgs:(NSArray*)args;
|
||||
@end
|
||||
|
||||
@@ -29,4 +29,18 @@
|
||||
{
|
||||
[super noteNewRecentDocumentURL:[PBGitRepository baseDirForURL:url]];
|
||||
}
|
||||
|
||||
- (id) openRepositoryAtLocation:(NSURL*) url RevParseArgs:(NSArray*)args
|
||||
{
|
||||
id document = [self documentForURL:url];
|
||||
if (!document) {
|
||||
document = [[PBGitRepository alloc] initWithURL:url andArguments:args];
|
||||
[self addDocument:document];
|
||||
[document makeWindowControllers];
|
||||
} else {
|
||||
// TODO: Add another revwalk specifier and show that.
|
||||
}
|
||||
[document showWindows];
|
||||
return document;
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user