Commit 746526d2 authored by Dan Allen's avatar Dan Allen
Browse files

store info about linked worktree on worktree property of repo object

parent 73058381
Loading
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -298,7 +298,7 @@ async function selectReferences (source, repo, remote) {
  const isBare = managed || repo.noCheckout
  const patternCache = repo.cache[REF_PATTERN_CACHE_KEY]
  const noWorktree = managed ? undefined : false
  const isLinkedWorktree = repo.worktreeName // perhaps switch to worktree property ({ name, dir}) in future
  const isLinkedWorktree = repo.worktree?.name
  const refs = new Map()
  if (
    tagPatterns &&
@@ -1084,7 +1084,8 @@ function resolveRepositoryFromWorktree (repo) {
        (contents) => {
          const gitdir = ospath.join(worktreeGitdir, contents.trimEnd())
          const dir = ospath.basename(gitdir) === '.git' ? ospath.dirname(gitdir) : gitdir
          return Object.assign(repo, { dir, gitdir, worktreeName: ospath.basename(worktreeGitdir) })
          const name = ospath.basename(worktreeGitdir)
          return Object.assign(repo, { dir, gitdir, worktree: { gitdir: worktreeGitdir, name } })
        },
        () => repo
      )