@@ -637,18 +637,22 @@ - (NSArray *)referenceNamesWithError:(NSError **)error {
637
637
}
638
638
639
639
- (NSURL *)fileURL {
640
- const char *path = git_repository_workdir (self.git_repository );
640
+ const char *cPath = git_repository_workdir (self.git_repository );
641
641
// bare repository, you may be looking for gitDirectoryURL
642
- if (path == NULL ) return nil ;
642
+ if (cPath == NULL ) return nil ;
643
643
644
- return [NSURL fileURLWithPath: @(path) isDirectory: YES ];
644
+ NSString *path = @(cPath);
645
+ NSAssert (path, @" workdir is nil" );
646
+ return [NSURL fileURLWithPath: path isDirectory: YES ];
645
647
}
646
648
647
649
- (NSURL *)gitDirectoryURL {
648
- const char *path = git_repository_path (self.git_repository );
649
- if (path == NULL ) return nil ;
650
+ const char *cPath = git_repository_path (self.git_repository );
651
+ if (cPath == NULL ) return nil ;
650
652
651
- return [NSURL fileURLWithPath: @(path) isDirectory: YES ];
653
+ NSString *path = @(cPath);
654
+ NSAssert (path, @" gitdirectory is nil" );
655
+ return [NSURL fileURLWithPath: path isDirectory: YES ];
652
656
}
653
657
654
658
- (BOOL )isBare {
@@ -737,7 +741,9 @@ static int submoduleEnumerationCallback(git_submodule *git_submodule, const char
737
741
738
742
NSError *error;
739
743
// Use -submoduleWithName:error: so that we get a git_submodule that we own.
740
- GTSubmodule *submodule = [info->parentRepository submoduleWithName: @(name) error: &error];
744
+ NSString *submoduleName = @(name);
745
+ NSCAssert (submoduleName, @" submodule name is nil" );
746
+ GTSubmodule *submodule = [info->parentRepository submoduleWithName: submoduleName error: &error];
741
747
742
748
BOOL stop = NO ;
743
749
info->block (submodule, error, &stop);
0 commit comments