Skip to content

Commit 2e60264

Browse files
committed
gitDirectoryURL can never be nil
It's asserted upon in libgit2.
1 parent c179bbc commit 2e60264

File tree

2 files changed

+2
-5
lines changed

2 files changed

+2
-5
lines changed

ObjectiveGit/GTRepository.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) {
159159
@property (nonatomic, readonly, strong) NSURL * _Nullable fileURL DEPRECATED_MSG_ATTRIBUTE("use -workingDirectoryURL");
160160

161161
/// The file URL for the repository's .git directory.
162-
@property (nonatomic, readonly, strong) NSURL * _Nullable gitDirectoryURL;
162+
@property (nonatomic, readonly, strong) NSURL *gitDirectoryURL;
163163

164164
/// Is this a bare repository (one without a working directory)?
165165
@property (nonatomic, readonly, getter = isBare) BOOL bare;

ObjectiveGit/GTRepository.m

+1-4
Original file line numberDiff line numberDiff line change
@@ -645,10 +645,7 @@ - (NSURL *)workingDirectoryURL {
645645
}
646646

647647
- (NSURL *)gitDirectoryURL {
648-
const char *path = git_repository_path(self.git_repository);
649-
if (path == NULL) return nil;
650-
651-
return [NSURL fileURLWithPath:@(path) isDirectory:YES];
648+
return [NSURL fileURLWithPath:@(git_repository_path(self.git_repository)) isDirectory:YES];
652649
}
653650

654651
- (BOOL)isBare {

0 commit comments

Comments
 (0)