Problem
In src/services/tags.ts, getGitEmail() calls execSync("git config user.email") without passing cwd, so it uses the process working directory rather than the project directory.
The recently added getGitRemoteUrl() correctly passes { cwd: directory }, creating an inconsistency between the two functions that have the same shape.
Impact
In practice this is low-risk because git user email is typically global (~/.gitconfig), but if a user has a per-repo email override, the wrong email could be read when the process working directory differs from the project directory.
Suggested Fix
Add a directory parameter to getGitEmail() and pass it as cwd:
export function getGitEmail(directory?: string): string | null {
try {
const email = execSync("git config user.email", {
cwd: directory,
encoding: "utf-8",
stdio: ["pipe", "pipe", "pipe"],
}).trim();
return email || null;
} catch {
return null;
}
}
Update the call site in getUserTag() (or pass directory through getTags).
Context
Found during systems review of PR #43.
Problem
In
src/services/tags.ts,getGitEmail()callsexecSync("git config user.email")without passingcwd, so it uses the process working directory rather than the project directory.The recently added
getGitRemoteUrl()correctly passes{ cwd: directory }, creating an inconsistency between the two functions that have the same shape.Impact
In practice this is low-risk because git user email is typically global (
~/.gitconfig), but if a user has a per-repo email override, the wrong email could be read when the process working directory differs from the project directory.Suggested Fix
Add a
directoryparameter togetGitEmail()and pass it ascwd:Update the call site in
getUserTag()(or pass directory throughgetTags).Context
Found during systems review of PR #43.