Skip to content

Commit a0593ed

Browse files
committed
gitDirectoryURL can never be nil
It's asserted upon in libgit2.
1 parent 3c55aaf commit a0593ed

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
@@ -643,10 +643,7 @@ - (NSURL *)workingDirectoryURL {
643643
}
644644

645645
- (NSURL *)gitDirectoryURL {
646-
const char *path = git_repository_path(self.git_repository);
647-
if (path == NULL) return nil;
648-
649-
return [NSURL fileURLWithPath:@(path) isDirectory:YES];
646+
return [NSURL fileURLWithPath:@(git_repository_path(self.git_repository)) isDirectory:YES];
650647
}
651648

652649
- (BOOL)isBare {

0 commit comments

Comments
 (0)