Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lib/gh/workers/_common.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,19 @@ export const clone = ({ argv, item }) => [
mkdirp({ argv, item }),
[
'gh',
['repo', 'clone', `${item.owner}/${item.name}`],
// template-oss will use upstream over origin, so we supply an alternate remote name for forked repos
['repo', 'clone', `${item.owner}/${item.name}`, '-u', 'parent'],
{
cwd: item.ownerDir,
status: ({ status, output }) =>
status === 1 && output.includes('already exists') && 0,
},
],
// choose the forked repo as the default, for operations like template-oss-fix
// See https://github.com/cli/cli/issues/9261#issuecomment-2193936803
['gh',
['repo', 'set-default', `${item.owner}/${item.name}`],
],
]

export const checkout = ({ argv }) => [
Expand Down