mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-29 15:30:40 -07:00
Shorten temp directory (#17901)
This commit is contained in:
@@ -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');
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user