Skip to content

Commit 398b146

Browse files
committed
enhance: the git dir of worktree's owner repository may not named .git
Signed-off-by: leo <[email protected]>
1 parent 5845ef3 commit 398b146

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ViewModels/Repository.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,7 @@ public void Open()
459459
{
460460
// For worktrees, we need to watch the $GIT_COMMON_DIR instead of the $GIT_DIR.
461461
var gitDirForWatcher = _gitDir;
462-
if (_gitDir.Replace("\\", "/").IndexOf(".git/worktrees/", StringComparison.Ordinal) > 0)
462+
if (_gitDir.Replace("\\", "/").IndexOf("/worktrees/", StringComparison.Ordinal) > 0)
463463
{
464464
var commonDir = new Commands.QueryGitCommonDir(_fullpath).Result();
465465
if (!string.IsNullOrEmpty(commonDir))

0 commit comments

Comments
 (0)