Refactor ProjectsManager.cloneProject to accept an options object

This commit is contained in:
Alex Gleason committed 2025-12-23 01:45:12 -06:00
1 parent b99c20c7f7
commit 8b8958f7c8
4 files changed
+26 -6

No files matched your search

+10 -2
View File
@@ -494,7 +494,14 @@ export class ProjectsManager {
}
}
async cloneProject(name: string, repoUrl: string, customId?: string, options?: { depth?: number }): Promise<Project> {
async cloneProject(options: {
name: string;
repoUrl: string;
customId?: string;
depth?: number;
remote?: string;
}): Promise<Project> {
const { name, repoUrl, customId, depth, remote } = options;
const id = customId || await this.generateUniqueProjectId(name);
// Check if project with this ID already exists when using custom ID
@@ -512,7 +519,8 @@ export class ProjectsManager {
dir: projectPath,
url: repoUrl,
singleBranch: true,
depth: options?.depth, // Use depth if provided, otherwise clone full history
depth, // Use depth if provided, otherwise clone full history
remote, // Use remote if provided, otherwise defaults to 'origin'
});
// Get filesystem stats for timestamps