Loading packages/content-aggregator/lib/aggregate-content.js +18 −20 Original line number Diff line number Diff line Loading @@ -1080,11 +1080,10 @@ function findWorktrees (repo, patterns) { patterns[0] === '.' && (patterns = patterns.slice(1)) ? getCurrentBranchName(repo).then((branch) => branch && [branch, { head: repo.dir, name: '.' }]) : Promise.resolve() const worktreesDir = patterns.length ? ospath.join(repo.dir, '.git', 'worktrees') : undefined if (!patterns.length) return mainWorktree.then((entry) => new Map(entry && [entry])) const worktreesDir = ospath.join(repo.dir, '.git', 'worktrees') const patternCache = repo.cache[REF_PATTERN_CACHE_KEY] return ( worktreesDir ? fsp return fsp .readdir(worktreesDir) .then((worktreeNames) => filterRefs(worktreeNames, patterns, patternCache), invariably.emptyArray) .then((worktreeNames) => Loading @@ -1100,8 +1099,7 @@ function findWorktrees (repo, patterns) { }) ) ) : Promise.resolve() ).then((entries = []) => mainWorktree.then((entry) => new Map(entry ? entries.push(entry) && entries : entries))) .then((entries) => mainWorktree.then((main) => (main ? new Map(entries).set(main[0], main[1]) : new Map(entries)))) } async function gracefulPromiseAllWithLimit (tasks, limit = Infinity) { Loading Loading
packages/content-aggregator/lib/aggregate-content.js +18 −20 Original line number Diff line number Diff line Loading @@ -1080,11 +1080,10 @@ function findWorktrees (repo, patterns) { patterns[0] === '.' && (patterns = patterns.slice(1)) ? getCurrentBranchName(repo).then((branch) => branch && [branch, { head: repo.dir, name: '.' }]) : Promise.resolve() const worktreesDir = patterns.length ? ospath.join(repo.dir, '.git', 'worktrees') : undefined if (!patterns.length) return mainWorktree.then((entry) => new Map(entry && [entry])) const worktreesDir = ospath.join(repo.dir, '.git', 'worktrees') const patternCache = repo.cache[REF_PATTERN_CACHE_KEY] return ( worktreesDir ? fsp return fsp .readdir(worktreesDir) .then((worktreeNames) => filterRefs(worktreeNames, patterns, patternCache), invariably.emptyArray) .then((worktreeNames) => Loading @@ -1100,8 +1099,7 @@ function findWorktrees (repo, patterns) { }) ) ) : Promise.resolve() ).then((entries = []) => mainWorktree.then((entry) => new Map(entry ? entries.push(entry) && entries : entries))) .then((entries) => mainWorktree.then((main) => (main ? new Map(entries).set(main[0], main[1]) : new Map(entries)))) } async function gracefulPromiseAllWithLimit (tasks, limit = Infinity) { Loading