mirror of
https://gitlab.com/soapbox-pub/shakespeare.git
synced 2026-12-06 00:27:24 +00:00
Clone non-owned Nostr repos to "upstream" remote
This commit is contained in:
3 files changed
+9
-5
No files matched your search
@@ -499,9 +499,9 @@ export class ProjectsManager {
|
||||
repoUrl: string;
|
||||
customId?: string;
|
||||
depth?: number;
|
||||
remote?: string;
|
||||
fork?: boolean;
|
||||
}): Promise<Project> {
|
||||
const { name, repoUrl, customId, depth, remote } = options;
|
||||
const { name, repoUrl, customId, depth, fork = false } = options;
|
||||
const id = customId || await this.generateUniqueProjectId(name);
|
||||
|
||||
// Check if project with this ID already exists when using custom ID
|
||||
@@ -515,12 +515,13 @@ export class ProjectsManager {
|
||||
|
||||
try {
|
||||
// Clone the repository (Git class now handles Nostr URIs automatically)
|
||||
// When forking, use 'upstream' as the remote name instead of 'origin'
|
||||
await this.git.clone({
|
||||
dir: projectPath,
|
||||
url: repoUrl,
|
||||
singleBranch: true,
|
||||
depth, // Use depth if provided, otherwise clone full history
|
||||
remote, // Use remote if provided, otherwise defaults to 'origin'
|
||||
remote: fork ? 'upstream' : undefined, // Use 'upstream' for forks, otherwise defaults to 'origin'
|
||||
});
|
||||
|
||||
// Get filesystem stats for timestamps
|
||||
|
||||
+2
-2
@@ -1288,9 +1288,9 @@ export class Git {
|
||||
throw lastError || new Error('All clone attempts failed');
|
||||
}
|
||||
|
||||
// After successful clone, update the origin remote to point to the Nostr URI
|
||||
// After successful clone, update the remote to point to the Nostr URI
|
||||
await this.setRemoteURL({
|
||||
remote: 'origin',
|
||||
remote: options.remote || 'origin',
|
||||
dir: options.dir,
|
||||
url: options.url,
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user