Pass env to execFileSync git calls (#1151)
Bun's execFileSync without an explicit env option spawns with the process startup environment, dropping runtime process.env mutations. The credential helper reads GH_TOKEN which is set at runtime, so git fetch in the restore-config path failed with empty password. Fixes #1139 🏠 Remote-Dev: homespace
This commit is contained in:
parent
c95e735eb1
commit
ba026a3e56
@ -118,7 +118,7 @@ export function validateBranchName(branchName: string): void {
|
|||||||
* @param args - Git command arguments (e.g., ["checkout", "branch-name"])
|
* @param args - Git command arguments (e.g., ["checkout", "branch-name"])
|
||||||
*/
|
*/
|
||||||
function execGit(args: string[]): void {
|
function execGit(args: string[]): void {
|
||||||
execFileSync("git", args, { stdio: "inherit" });
|
execFileSync("git", args, { stdio: "inherit", env: process.env });
|
||||||
}
|
}
|
||||||
|
|
||||||
export type BranchInfo = {
|
export type BranchInfo = {
|
||||||
|
|||||||
@ -48,6 +48,7 @@ export function restoreConfigFromBase(baseBranch: string): void {
|
|||||||
// caller sees a clean error.
|
// caller sees a clean error.
|
||||||
execFileSync("git", ["fetch", "origin", baseBranch, "--depth=1"], {
|
execFileSync("git", ["fetch", "origin", baseBranch, "--depth=1"], {
|
||||||
stdio: "inherit",
|
stdio: "inherit",
|
||||||
|
env: process.env,
|
||||||
});
|
});
|
||||||
|
|
||||||
// Delete PR-controlled versions. If the restore below fails for a given path,
|
// Delete PR-controlled versions. If the restore below fails for a given path,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user