Skip to content
Browse files

Fix working directory path for submodules

This was causing a problem where running 'gitx'
in a submodule directory caused the submodules'
index file to remain locked forever.
  • Loading branch information...
1 parent d01c0ef commit e481f37a1aae7ddc04f227396830f6ed7ee07759 @carlbrown carlbrown committed with carlbrown
Showing with 2 additions and 0 deletions.
  1. +2 −0 PBGitRepository.m
View
2 PBGitRepository.m
@@ -509,6 +509,8 @@ - (NSString *)workingDirectory
{
if ([self.fileURL.path hasSuffix:@"/.git"])
return [self.fileURL.path substringToIndex:[self.fileURL.path length] - 5];
+ else if ([[self config] valueForKeyPath:@"core.worktree"])
+ return [self.fileURL.path stringByAppendingPathComponent:[[self config] valueForKeyPath:@"core.worktree"]];
else
return self.fileURL.path; // probably submodule
}

0 comments on commit e481f37

Please sign in to comment.
Something went wrong with that request. Please try again.