Don't pass author into git functions - use values from config

This commit is contained in:
Alex Gleason committed 2025-12-22 20:56:41 -06:00
1 parent 6a7ec8413a
commit 91313764aa
3 files changed
+37 -93

No files matched your search

+1 -50
View File
@@ -306,7 +306,7 @@ describe('Git', () => {
const { readGitSettings } = await import('./configUtils');
vi.mocked(readGitSettings).mockResolvedValue({
credentials: [],
coAuthorEnabled: true,
coAuthorEnabled: false,
});
await gitInstance.commit({
@@ -322,10 +322,6 @@ describe('Git', () => {
name: 'shakespeare.diy',
email: '[email protected]',
},
committer: {
name: 'shakespeare.diy',
email: '[email protected]',
},
});
});
@@ -351,10 +347,6 @@ describe('Git', () => {
name: 'John Doe',
email: '[email protected]',
},
committer: {
name: 'John Doe',
email: '[email protected]',
},
});
});
@@ -380,47 +372,6 @@ describe('Git', () => {
name: 'John Doe',
email: '[email protected]',
},
committer: {
name: 'John Doe',
email: '[email protected]',
},
});
});
it('respects provided author when explicitly passed', async () => {
const { readGitSettings } = await import('./configUtils');
vi.mocked(readGitSettings).mockResolvedValue({
credentials: [],
name: 'John Doe',
email: '[email protected]',
coAuthorEnabled: true,
});
await gitInstance.commit({
dir: '/test',
message: 'Test commit',
author: {
name: 'Custom Author',
email: '[email protected]',
},
committer: {
name: 'Custom Committer',
email: '[email protected]',
},
});
expect(mockGit.commit).toHaveBeenCalledWith({
fs,
dir: '/test',
message: 'Test commit',
author: {
name: 'Custom Author',
email: '[email protected]',
},
committer: {
name: 'Custom Committer',
email: '[email protected]',
},
});
});
});