From e015fd7be4e91a33ad50b025f89357dda2f02d61 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciar=C3=A1n=20Walsh?= Date: Mon, 18 Aug 2008 17:24:50 +0100 Subject: [PATCH] =?UTF-8?q?Overriding=20-documentForURL:=20to=20use=20+git?= =?UTF-8?q?DirForURL:=20to=20convert=20incoming=20URLs=20to=20the=20.git?= =?UTF-8?q?=20dir=20before=20checking=20for=20an=20open=20document,=20so?= =?UTF-8?q?=20that=20open=20a=20repository=20from=20subdirectories=20won?= =?UTF-8?q?=E2=80=99t=20open=20duplicate=20windows.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- PBRepositoryDocumentController.m | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/PBRepositoryDocumentController.m b/PBRepositoryDocumentController.m index 9f13c57..b4d8a45 100644 --- a/PBRepositoryDocumentController.m +++ b/PBRepositoryDocumentController.m @@ -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