Shorten temp directory (#17901)

This commit is contained in:
joshualitt
2026-02-06 08:10:17 -08:00
committed by GitHub
parent 30354892b3
commit 6fb3b09003
24 changed files with 989 additions and 27 deletions

View File

@@ -18,13 +18,11 @@ import { Storage } from '../config/storage.js';
import * as path from 'node:path';
import * as fs from 'node:fs/promises';
import * as os from 'node:os';
import {
getProjectHash,
GEMINI_DIR,
homedir as pathsHomedir,
} from '../utils/paths.js';
import { GEMINI_DIR, homedir as pathsHomedir } from '../utils/paths.js';
import { spawnAsync } from '../utils/shell-utils.js';
const PROJECT_SLUG = 'project-slug';
vi.mock('../utils/shell-utils.js', () => ({
spawnAsync: vi.fn(),
}));
@@ -85,7 +83,6 @@ describe('GitService', () => {
let testRootDir: string;
let projectRoot: string;
let homedir: string;
let hash: string;
let storage: Storage;
beforeEach(async () => {
@@ -95,8 +92,6 @@ describe('GitService', () => {
await fs.mkdir(projectRoot, { recursive: true });
await fs.mkdir(homedir, { recursive: true });
hash = getProjectHash(projectRoot);
vi.clearAllMocks();
hoistedIsGitRepositoryMock.mockReturnValue(true);
(spawnAsync as Mock).mockResolvedValue({
@@ -181,8 +176,8 @@ describe('GitService', () => {
let repoDir: string;
let gitConfigPath: string;
beforeEach(() => {
repoDir = path.join(homedir, GEMINI_DIR, 'history', hash);
beforeEach(async () => {
repoDir = path.join(homedir, GEMINI_DIR, 'history', PROJECT_SLUG);
gitConfigPath = path.join(repoDir, '.gitconfig');
});