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:
Ciarán Walsh
2008-08-18 17:24:50 +01:00
parent e5b2f0d2b9
commit e015fd7be4
+7 -1
View File
@@ -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