mirror of
https://github.com/jparkerweb/plan2code.git
synced 2026-11-16 20:45:33 -08:00
Run test fixtures' git under the scripts' scrubbed config, so a global core.autocrlf no longer fails git plan switch
AI Assisted
This commit is contained in:
1 parent
68d1f82a2e
commit
498e09bb15
2 files changed
+7
-2
No files matched your search
@@ -83,8 +83,12 @@ export function write(root, rel, content) {
|
||||
|
||||
export const read = (root, rel) => fs.readFileSync(path.join(root, rel), "utf8");
|
||||
|
||||
/** A git runner for `dir`. */
|
||||
export const gitIn = (dir) => (...a) => execFileSync("git", a, { cwd: dir, stdio: "pipe", encoding: "utf8" });
|
||||
/**
|
||||
* A git runner for `dir`, under the same scrubbed config the scripts get: with
|
||||
* the ambient config, a global core.autocrlf=true checks files out with CRLF
|
||||
* that the scripts (autocrlf off) then read as changed.
|
||||
*/
|
||||
export const gitIn = (dir) => (...a) => execFileSync("git", a, { cwd: dir, stdio: "pipe", encoding: "utf8", env: scrubbedEnv() });
|
||||
|
||||
export function gitInit(dir, branch = "main") {
|
||||
const g = gitIn(dir);
|
||||
|
||||
Reference in new issue
Block a user