Provide a .gitconfig for shadow repos (#1294)

This commit is contained in:
Louis Jimenez
2025-06-22 00:13:03 -04:00
committed by GitHub
parent 0779697da6
commit 383212034c
2 changed files with 26 additions and 5 deletions

View File

@@ -188,6 +188,18 @@ describe('GitService', () => {
const repoDir = path.join(mockHomedir, '.gemini', 'history', mockHash);
const hiddenGitIgnorePath = path.join(repoDir, '.gitignore');
const visibleGitIgnorePath = path.join(mockProjectRoot, '.gitignore');
const gitConfigPath = path.join(repoDir, '.gitconfig');
it('should create a .gitconfig file with the correct content', async () => {
const service = new GitService(mockProjectRoot);
await service.setupShadowGitRepository();
const expectedConfigContent =
'[user]\n name = Gemini CLI\n email = gemini-cli@google.com\n[commit]\n gpgsign = false\n';
expect(hoistedMockWriteFile).toHaveBeenCalledWith(
gitConfigPath,
expectedConfigContent,
);
});
it('should create history and repository directories', async () => {
const service = new GitService(mockProjectRoot);