diff --git a/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php b/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php --- a/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php +++ b/src/workingcopyidentity/ArcanistWorkingCopyIdentity.php @@ -180,6 +180,16 @@ $identity = new ArcanistWorkingCopyIdentity($project_root, $config); $identity->localMetaDir = $vcs_root.'/.'.$vcs_type; + if ($vcs_type == 'git' && !is_dir($identity->localMetaDir)) { + /* Find the .git directory for git-worktrees: */ + list($gitdir) = execx('git rev-parse --git-dir'); + $identity->localMetaDir = trim($gitdir); + $console->writeLog( + "%s\n", + pht( + 'Working Copy: Git dir for worktree "%s" is at "%s".', + $vcs_root, $identity->localMetaDir)); + } $identity->localConfig = $identity->readLocalArcConfig(); $identity->vcsType = $vcs_type; $identity->vcsRoot = $vcs_root;