Skip to content

Commit ad2edbd

Browse files
committed
Merge pull request laullon#5 from carlbrown/master
Fix worktree path when running gitx inside a submodule directory
2 parents d01c0ef + e481f37 commit ad2edbd

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)