mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
Overriding -documentForURL: to use +gitDirForURL: to convert incoming URLs to the .git dir before checking for an open document, so that open a repository from subdirectories won’t open duplicate windows.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
//
|
||||
|
||||
#import "PBRepositoryDocumentController.h"
|
||||
|
||||
#import "PBGitRepository.h"
|
||||
|
||||
@implementation PBRepositoryDocumentController
|
||||
// This method is overridden to configure the open panel to only allow
|
||||
@@ -18,4 +18,10 @@
|
||||
[openPanel setCanChooseDirectories:YES];
|
||||
return [openPanel runModalForDirectory:nil file:nil types:nil];
|
||||
}
|
||||
|
||||
// Convert paths to the .git dir before searching for an already open document
|
||||
- (id)documentForURL:(NSURL *)URL
|
||||
{
|
||||
return [super documentForURL:[PBGitRepository gitDirForURL:URL]];
|
||||
}
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user