Skip to content

Commit 167d13f

Browse files
committed
gitDirectoryURL can never be nil
It's asserted upon in libgit2.
1 parent c294035 commit 167d13f

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
@@ -156,7 +156,7 @@ typedef NS_ENUM(NSInteger, GTRepositoryStateType) {
156156
/// Returns nil for a bare repository.
157157
@property (nonatomic, readonly, strong) NSURL * _Nullable fileURL;
158158
/// The file URL for the repository's .git directory.
159-
@property (nonatomic, readonly, strong) NSURL * _Nullable gitDirectoryURL;
159+
@property (nonatomic, readonly, strong) NSURL *gitDirectoryURL;
160160

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

ObjectiveGit/GTRepository.m

+1-4
Original file line numberDiff line numberDiff line change
@@ -641,10 +641,7 @@ - (NSURL *)fileURL {
641641
}
642642

643643
- (NSURL *)gitDirectoryURL {
644-
const char *path = git_repository_path(self.git_repository);
645-
if (path == NULL) return nil;
646-
647-
return [NSURL fileURLWithPath:@(path) isDirectory:YES];
644+
return [NSURL fileURLWithPath:@(git_repository_path(self.git_repository)) isDirectory:YES];
648645
}
649646

650647
- (BOOL)isBare {

0 commit comments

Comments
 (0)