fix(git-worktree): use trimEnd instead of trim to preserve leading whitespace
Git status porcelain output uses leading spaces for status indicators; trim() was stripping them which could break parsing.
This commit is contained in:
parent
fb19e544c9
commit
3553ab79e1
@ -12,21 +12,21 @@ export function collectGitDiffStats(directory: string): GitFileStat[] {
|
|||||||
encoding: "utf-8",
|
encoding: "utf-8",
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
stdio: ["pipe", "pipe", "pipe"],
|
stdio: ["pipe", "pipe", "pipe"],
|
||||||
}).trim()
|
}).trimEnd()
|
||||||
|
|
||||||
const statusOutput = execFileSync("git", ["status", "--porcelain"], {
|
const statusOutput = execFileSync("git", ["status", "--porcelain"], {
|
||||||
cwd: directory,
|
cwd: directory,
|
||||||
encoding: "utf-8",
|
encoding: "utf-8",
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
stdio: ["pipe", "pipe", "pipe"],
|
stdio: ["pipe", "pipe", "pipe"],
|
||||||
}).trim()
|
}).trimEnd()
|
||||||
|
|
||||||
const untrackedOutput = execFileSync("git", ["ls-files", "--others", "--exclude-standard"], {
|
const untrackedOutput = execFileSync("git", ["ls-files", "--others", "--exclude-standard"], {
|
||||||
cwd: directory,
|
cwd: directory,
|
||||||
encoding: "utf-8",
|
encoding: "utf-8",
|
||||||
timeout: 5000,
|
timeout: 5000,
|
||||||
stdio: ["pipe", "pipe", "pipe"],
|
stdio: ["pipe", "pipe", "pipe"],
|
||||||
}).trim()
|
}).trimEnd()
|
||||||
|
|
||||||
const untrackedNumstat = untrackedOutput
|
const untrackedNumstat = untrackedOutput
|
||||||
? untrackedOutput
|
? untrackedOutput
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user