mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-03 12:17:20 +02:00
test: fix Windows test for gitUtils (#6951)
* test: fix Windows test for gitUtils * change this * fix
This commit is contained in:
parent
5ee7e8c48e
commit
c696dc2cd6
2 changed files with 9 additions and 4 deletions
|
@ -23,6 +23,12 @@ function createTempRepo() {
|
||||||
stderr: ${res.stderr}
|
stderr: ${res.stderr}
|
||||||
stdout: ${res.stdout}`);
|
stdout: ${res.stdout}`);
|
||||||
}
|
}
|
||||||
|
// Doesn't matter currently
|
||||||
|
shell.exec('git config user.email "test@jc-verse.com"', {
|
||||||
|
cwd: dir,
|
||||||
|
silent: true,
|
||||||
|
});
|
||||||
|
shell.exec('git config user.name "Test"', {cwd: dir, silent: true});
|
||||||
}
|
}
|
||||||
commit(msg: string, date: string, author: string) {
|
commit(msg: string, date: string, author: string) {
|
||||||
const addRes = shell.exec('git add .', {cwd: this.dir, silent: true});
|
const addRes = shell.exec('git add .', {cwd: this.dir, silent: true});
|
||||||
|
@ -30,10 +36,7 @@ stdout: ${res.stdout}`);
|
||||||
`git commit -m "${msg}" --date "${date}T00:00:00Z" --author "${author}"`,
|
`git commit -m "${msg}" --date "${date}T00:00:00Z" --author "${author}"`,
|
||||||
{
|
{
|
||||||
cwd: this.dir,
|
cwd: this.dir,
|
||||||
env: {
|
env: {GIT_COMMITTER_DATE: `${date}T00:00:00Z`},
|
||||||
GIT_COMMITTER_DATE: `${date}T00:00:00Z`,
|
|
||||||
GIT_COMMITTER_NAME: author,
|
|
||||||
},
|
|
||||||
silent: true,
|
silent: true,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
|
@ -53,6 +53,8 @@ export function getFileCommitDate(
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Commit time and author name; not using author time so that amended commits
|
||||||
|
// can have their dates updated
|
||||||
let formatArg = '--format=%ct';
|
let formatArg = '--format=%ct';
|
||||||
if (includeAuthor) {
|
if (includeAuthor) {
|
||||||
formatArg += ',%an';
|
formatArg += ',%an';
|
||||||
|
|
Loading…
Add table
Reference in a new issue