feat: git implementation finished

This commit is contained in:
2026-02-16 17:41:45 +01:00
parent e9743cb70f
commit 0f04b98d60
3 changed files with 69 additions and 345 deletions

View File

@@ -835,5 +835,25 @@ describe('GitEngine', () => {
expect.stringContaining('repository'),
]));
});
it('should classify pull merge conflicts with conflict code', async () => {
mockPull.mockRejectedValue(new Error('CONFLICT (content): Merge conflict in posts/first.md'));
const result = await gitEngine.pull('/tmp/project');
expect(result.success).toBe(false);
expect(result.code).toBe('conflict');
expect(result.error).toContain('Merge conflict');
});
it('should classify fetch connectivity issues with network code', async () => {
mockFetch.mockRejectedValue(new Error('fatal: unable to access https://example.com/repo.git: Could not resolve host'));
const result = await gitEngine.fetch('/tmp/project');
expect(result.success).toBe(false);
expect(result.code).toBe('network');
expect(result.error).toContain('Could not resolve host');
});
});
});