Skip to content

Commit a196974

Browse files
committed
Need to set committer, not author
1 parent 719201f commit a196974

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

tests/helpers/local-repo.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
105105
* `createInitialCommit: true`.
106106
*/
107107
protected async afterInitialize() {
108+
await super.afterInitialize();
109+
108110
if (this.#createInitialCommit) {
109111
await this.createCommit('Initial commit');
110112
}

tests/helpers/repo.ts

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,7 @@ export default abstract class Repo {
165165
await sleepFor(MIN_TIME_BETWEEN_COMMITS - timeSincePreviousCommit);
166166
}
167167
await this.runCommand('git', ['add', '-A']);
168-
const result = await this.runCommand('git', [
169-
'commit',
170-
'--author',
171-
'Test User <test@example.com>',
172-
'--message',
173-
message,
174-
]);
168+
const result = await this.runCommand('git', ['commit', '-m', message]);
175169
this.#latestCommitTime = now;
176170
return result;
177171
}
@@ -235,10 +229,12 @@ export default abstract class Repo {
235229

236230
/**
237231
* Custom logic with which to further initialize the repo after it is created.
232+
* By default, this configures Git to use an email and name for commits.
238233
* Can be overridden in subclasses.
239234
*/
240235
protected async afterInitialize(): Promise<void> {
241-
// no-op
236+
await this.runCommand('git', ['config', 'user.email', 'test@example.com']);
237+
await this.runCommand('git', ['config', 'user.name', 'Test User']);
242238
}
243239

244240
/**

0 commit comments

Comments
 (0)