Skip to content

Commit a0139bb

Browse files
committed
fix tests - use config when setting up repo & set creds before creating default signature
Signed-off-by: Kipras Melnikovas <kipras@kipras.org>
1 parent 0f23eeb commit a0139bb

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

test/experiment.spec.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,11 @@ export async function testCase() {
2626

2727
const {
2828
repo, //
29+
config,
2930
sig,
3031
dir,
3132
} = await setupRepo();
3233

33-
const config: Git.Config = await repo.config();
34-
35-
await config.setBool(configKeys.autoApplyIfNeeded, Git.Config.MAP.FALSE);
36-
await config.setString("user.email", "tester@test.com");
37-
await config.setString("user.name", "tester");
38-
3934
const commitOidsInInitial: Git.Oid[] = [];
4035
const initialBranch: Git.Reference = await appendCommitsTo(commitOidsInInitial, 3, repo, sig);
4136

@@ -167,6 +162,12 @@ export async function setupRepo() {
167162
const isBare = 0;
168163
const repo: Git.Repository = await Git.Repository.init(dir, isBare);
169164

165+
const config: Git.Config = await repo.config();
166+
167+
await config.setBool(configKeys.autoApplyIfNeeded, Git.Config.MAP.FALSE);
168+
await config.setString("user.email", "tester@test.com");
169+
await config.setString("user.name", "tester");
170+
170171
const sig: Git.Signature = await Git.Signature.default(repo);
171172
log("sig %s", sig);
172173

@@ -178,6 +179,7 @@ export async function setupRepo() {
178179
return {
179180
dir,
180181
repo,
182+
config,
181183
sig,
182184
initialCommit,
183185
} as const;

0 commit comments

Comments
 (0)