Fix getting the correct git directory

If the path already includes the .git directory then rev-parse will return "." to mean the current directory.
This commit is contained in:
Nathan Kinsinger
2010-08-15 19:43:01 -06:00
parent 7b17eec476
commit 2529c02814
+2
View File
@@ -61,6 +61,8 @@ NSString* PBGitRepositoryErrorDomain = @"GitXErrorDomain";
if ([newPath isEqualToString:@".git"])
return [NSURL fileURLWithPath:[repositoryPath stringByAppendingPathComponent:@".git"]];
if ([newPath isEqualToString:@"."])
return [NSURL fileURLWithPath:repositoryPath];
if ([newPath length] > 0)
return [NSURL fileURLWithPath:newPath];