We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e6ce73f commit 82450dcCopy full SHA for 82450dc
src/helpers/worktree/getWorktrees.ts
@@ -1,6 +1,6 @@
1
import { executeCommand } from '#/helpers/general';
2
import { BARE_REPOSITORY } from '#/src/config/constants';
3
-import { getCurrentBranchName } from '../git';
+import { getCurrentBranchName, isInsideBareRepository } from '../git';
4
import { removeFirstAndLastCharacter } from '../string';
5
6
export const getWorktrees = async (
@@ -12,10 +12,12 @@ export const getWorktrees = async (
12
try {
13
const { stdout } = await executeCommand(command);
14
15
+ const isRootDirectory = await isInsideBareRepository();
16
+
17
const worktrees = await getFilteredWorktrees(
18
stdout,
19
withBareRepo,
- showCurrentWorktree
20
+ isRootDirectory || showCurrentWorktree
21
);
22
23
return worktrees;
0 commit comments