Skip to content

Commit e481f37

Browse files
committed
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.
1 parent d01c0ef commit e481f37

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

PBGitRepository.m

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -509,6 +509,8 @@ - (NSString *)workingDirectory
509509
{
510510
if ([self.fileURL.path hasSuffix:@"/.git"])
511511
return [self.fileURL.path substringToIndex:[self.fileURL.path length] - 5];
512+
else if ([[self config] valueForKeyPath:@"core.worktree"])
513+
return [self.fileURL.path stringByAppendingPathComponent:[[self config] valueForKeyPath:@"core.worktree"]];
512514
else
513515
return self.fileURL.path; // probably submodule
514516
}

0 commit comments

Comments
 (0)