Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/services/tags.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ function getGitRoot(directory: string): string | null {
cwd: directory,
encoding: "utf-8",
stdio: ["pipe", "pipe", "pipe"],
windowsHide: true,
}).trim();
return gitRoot || null;
}
Expand All @@ -31,13 +32,15 @@ function getGitRoot(directory: string): string | null {
cwd: directory,
encoding: "utf-8",
stdio: ["pipe", "pipe", "pipe"],
windowsHide: true,
}).trim();

if (gitCommonDir === ".git") {
const gitRoot = execSync("git rev-parse --show-toplevel", {
cwd: directory,
encoding: "utf-8",
stdio: ["pipe", "pipe", "pipe"],
windowsHide: true,
}).trim();
return gitRoot || null;
}
Expand All @@ -51,6 +54,7 @@ function getGitRoot(directory: string): string | null {
cwd: directory,
encoding: "utf-8",
stdio: ["pipe", "pipe", "pipe"],
windowsHide: true,
}).trim();
return gitRoot || null;
} catch {
Expand All @@ -68,6 +72,7 @@ function getGitEmail(directory: string): string | null {
cwd: getProjectBasePath(directory),
encoding: "utf-8",
stdio: ["pipe", "pipe", "pipe"],
windowsHide: true,
}).trim();
return email || null;
} catch {
Expand Down Expand Up @@ -120,6 +125,7 @@ function getGitRepoInfo(directory: string): {
cwd: directory,
encoding: "utf-8",
stdio: ["pipe", "pipe", "pipe"],
windowsHide: true,
}).trim();
const normalizedRemote = normalizeGitRemote(remoteUrl);
const displayRemote = remoteUrl.replace(/\/+$/, "").replace(/\.git$/i, "");
Expand Down