mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 08:37:22 +00:00
Make git identity configurable in settings
This commit is contained in:
13 files changed
+270
-108
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user