mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 08:37:22 +00:00
Clone full repo history, except when cloning a stack (for a new project)
This commit is contained in:
2 files changed
+4
-8
No files matched your search
@@ -37,7 +37,7 @@ export class ProjectsManager {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async createProject(name: string, customId?: string): Promise<Project> {
|
async createProject(name: string, customId?: string): Promise<Project> {
|
||||||
const project = await this.cloneProject(name, GIT_TEMPLATE_URL, customId);
|
const project = await this.cloneProject(name, GIT_TEMPLATE_URL, customId, { depth: 1 });
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await this.fs.mkdir(this.dir + `/${project.id}/.ai/history`, { recursive: true });
|
await this.fs.mkdir(this.dir + `/${project.id}/.ai/history`, { recursive: true });
|
||||||
@@ -93,7 +93,7 @@ export class ProjectsManager {
|
|||||||
return project;
|
return project;
|
||||||
}
|
}
|
||||||
|
|
||||||
async cloneProject(name: string, repoUrl: string, customId?: string): Promise<Project> {
|
async cloneProject(name: string, repoUrl: string, customId?: string, options?: { depth?: number }): Promise<Project> {
|
||||||
const url = new URL(repoUrl);
|
const url = new URL(repoUrl);
|
||||||
const id = customId || await this.generateUniqueProjectId(name);
|
const id = customId || await this.generateUniqueProjectId(name);
|
||||||
|
|
||||||
@@ -113,7 +113,7 @@ export class ProjectsManager {
|
|||||||
dir: projectPath,
|
dir: projectPath,
|
||||||
url: repoUrl,
|
url: repoUrl,
|
||||||
singleBranch: true,
|
singleBranch: true,
|
||||||
depth: 1,
|
depth: options?.depth, // Use depth if provided, otherwise clone full history
|
||||||
// Use the CORS proxy only for GitHub and GitLab URLs
|
// Use the CORS proxy only for GitHub and GitLab URLs
|
||||||
// More info: https://github.com/isomorphic-git/isomorphic-git#cors-support
|
// More info: https://github.com/isomorphic-git/isomorphic-git#cors-support
|
||||||
corsProxy: url.hostname === 'github.com' || url.hostname === 'gitlab.com'
|
corsProxy: url.hostname === 'github.com' || url.hostname === 'gitlab.com'
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export class GitLogCommand implements GitSubcommand {
|
|||||||
try {
|
try {
|
||||||
await fs.stat(`${cwd}/.git`);
|
await fs.stat(`${cwd}/.git`);
|
||||||
} catch {
|
} catch {
|
||||||
return createErrorError('fatal: not a git repository (or any of the parent directories): .git');
|
return createErrorResult('fatal: not a git repository (or any of the parent directories): .git');
|
||||||
}
|
}
|
||||||
|
|
||||||
const { options, limit } = this.parseArgs(args);
|
const { options, limit } = this.parseArgs(args);
|
||||||
@@ -142,7 +142,3 @@ export class GitLogCommand implements GitSubcommand {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Fix the typo in the error function
|
|
||||||
function createErrorError(message: string): ShellCommandResult {
|
|
||||||
return createErrorResult(message);
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user