Check if a repository is valid

This commit is contained in:
Pieter de Bie
2008-09-20 12:14:58 +02:00
parent 7f337cda2a
commit ef6b506dc7
2 changed files with 7 additions and 1 deletions
+4 -1
View File
@@ -138,8 +138,11 @@ static NSString* gitPath;
- (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];
+3
View File
@@ -36,6 +36,9 @@
id document = [self documentForURL:url];
if (!document) {
document = [[PBGitRepository alloc] initWithURL:url andRevSpecifier:rev];
if (!document)
return nil;
[self addDocument:document];
[document makeWindowControllers];
} else {