Make git identity configurable in settings

This commit is contained in:
Alex Gleason committed 2025-10-14 20:36:29 -05:00
1 parent 51f7a42d3e
commit e4c3fc8b05
13 files changed
+270 -108

No files matched your search

-35
View File
@@ -75,14 +75,6 @@ describe('GitCommitTool', () => {
expect(mockGitInstance.commit).toHaveBeenCalledWith({
dir: '/test/project',
message: 'Add new feature',
author: {
name: 'shakespeare.diy',
email: '[email protected]',
},
committer: {
name: 'shakespeare.diy',
email: '[email protected]',
},
});
expect(result).toContain('✅ Successfully committed 2 files (abcd123)');
expect(result).toContain('Add new feature');
@@ -179,34 +171,7 @@ describe('GitCommitTool', () => {
expect(result).toContain('📊 Changes:');
});
it('should use git config when available', async () => {
// Mock .git directory exists
vi.mocked(mockFS.stat).mockResolvedValue({
isDirectory: () => true,
isFile: () => false,
});
// Mock git config
vi.mocked(mockGitInstance.getConfig)
.mockResolvedValueOnce('John Doe') // user.name
.mockResolvedValueOnce('[email protected]'); // user.email
const result = await tool.execute({ message: 'Test commit' });
expect(mockGitInstance.commit).toHaveBeenCalledWith({
dir: '/test/project',
message: 'Test commit',
author: {
name: 'John Doe',
email: '[email protected]',
},
committer: {
name: 'John Doe',
email: '[email protected]',
},
});
expect(result).toContain('✅ Successfully committed');
});
it('should handle very long commit message', async () => {
// Mock .git directory exists