Skip to content

Commit

Permalink
pull on main, fetch on others
Browse files Browse the repository at this point in the history
  • Loading branch information
Tobbe committed Dec 31, 2023
1 parent cab5ee0 commit d622ca5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions tasks/release/releaseLib.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,8 @@ export function prompts(promptsObject, promptsOptions) {
// ─── Branch Statuses ─────────────────────────────────────────────────────────

/**
* Basically runs `git pull upstream` on branches with safety checks and logging.
* Basically runs `git pull upstream` or `git fetch upstream` on branches with
* safety checks and logging.
*
* @param {string[]} branches
*/
Expand Down Expand Up @@ -310,13 +311,17 @@ export async function handleBranchesToCommits(
].join('\n')
} else {
for (const [branch, status] of Object.entries(branchesToCommits)) {
const pullOrFetch = branch === 'main' ? 'pull' : 'fetch'

if (
status.commitsExclusiveToRemoteBranch &&
isYes(
await question(`Ok to \`git pull\` ${chalk.magenta(branch)}? [Y/n] `)
await question(
`Ok to \`git ${pullOrFetch}\` ${chalk.magenta(branch)}? [Y/n] `
)
)
) {
await $`git pull ${redwoodRemote} ${branch}:${branch}`
await $`git ${pullOrFetch} ${redwoodRemote} ${branch}:${branch}`
}
}
}
Expand Down

0 comments on commit d622ca5

Please sign in to comment.