Skip to content

Commit b1c0fef

Browse files
committed
fix: adjust repo org/name detection
1 parent 8998f8c commit b1c0fef

1 file changed

Lines changed: 8 additions & 8 deletions

File tree

src/sync/service.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -371,15 +371,15 @@ async function resolveRepoFromInit($: Shell, options: InitOptions) {
371371
if (options.repo.includes('://') || options.repo.endsWith('.git')) {
372372
return { url: options.repo, branch: options.branch };
373373
}
374-
const [owner, name] = options.repo.split('/');
375-
if (owner && name) {
376-
return { owner, name, branch: options.branch };
377-
}
378-
// If only a name is provided (no slash), use it as the repo name with auto-detected owner
379-
if (options.repo && !options.repo.includes('/')) {
380-
const owner = await getAuthenticatedUser($);
381-
return { owner, name: options.repo, branch: options.branch };
374+
if (options.repo.includes('/')) {
375+
const [owner, name] = options.repo.split('/');
376+
if (owner && name) {
377+
return { owner, name, branch: options.branch };
378+
}
382379
}
380+
381+
const owner = await getAuthenticatedUser($);
382+
return { owner, name: options.repo, branch: options.branch };
383383
}
384384

385385
// Default: auto-detect owner, use default repo name

0 commit comments

Comments
 (0)