Skip to content

Commit

Permalink
Check if a repository is valid
Browse files Browse the repository at this point in the history
  • Loading branch information
pieter committed Sep 20, 2008
1 parent 7f337cd commit ef6b506
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion PBGitRepository.m
Original file line number Diff line number Diff line change
Expand Up @@ -138,8 +138,11 @@ - (void) setup

- (id) initWithURL: (NSURL*) path andRevSpecifier:(PBGitRevSpecifier*) rev
{
self = [self init];
NSURL* gitDirURL = [PBGitRepository gitDirForURL:path];
if (!gitDirURL)
return nil;

self = [self init];
[self setFileURL: gitDirURL];

[self setup];
Expand Down
3 changes: 3 additions & 0 deletions PBRepositoryDocumentController.m
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ - (id) openRepositoryAtLocation:(NSURL*) url RevSpecifier:(PBGitRevSpecifier*) r
id document = [self documentForURL:url];
if (!document) {
document = [[PBGitRepository alloc] initWithURL:url andRevSpecifier:rev];
if (!document)
return nil;

[self addDocument:document];
[document makeWindowControllers];
} else {
Expand Down

0 comments on commit ef6b506

Please sign in to comment.