mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
12faa4a8f0
Instead (for non-bare repos) add the directory above the .git dir.
33 lines
922 B
Objective-C
33 lines
922 B
Objective-C
//
|
|
// PBRepositoryDocumentController.mm
|
|
// GitX
|
|
//
|
|
// Created by Ciarán Walsh on 15/08/2008.
|
|
// Copyright 2008 __MyCompanyName__. All rights reserved.
|
|
//
|
|
|
|
#import "PBRepositoryDocumentController.h"
|
|
#import "PBGitRepository.h"
|
|
|
|
@implementation PBRepositoryDocumentController
|
|
// This method is overridden to configure the open panel to only allow
|
|
// selection of directories
|
|
- (NSInteger)runModalOpenPanel:(NSOpenPanel *)openPanel forTypes:(NSArray *)extensions
|
|
{
|
|
[openPanel setCanChooseFiles:NO];
|
|
[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]];
|
|
}
|
|
|
|
- (void)noteNewRecentDocumentURL:(NSURL*)url
|
|
{
|
|
[super noteNewRecentDocumentURL:[PBGitRepository baseDirForURL:url]];
|
|
}
|
|
@end
|