Skip to content

Commit

Permalink
When base is set, fetch depth=1
Browse files Browse the repository at this point in the history
  • Loading branch information
webmonarch committed Mar 7, 2024
1 parent b3a2c5d commit 83b42f6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ function createOrUpdateBranch(git, commitMessage, base, branch, branchRemoteName
if (workingBase != base) {
core.info(`Rebasing commits made to ${workingBaseType} '${workingBase}' on to base branch '${base}'`);
// Checkout the actual base
yield git.fetch([`${base}:${base}`], baseRemote, ['--force']);
yield git.fetch([`${base}:${base}`], baseRemote, ['--force', '--depth=1']);
yield git.checkout(base);
// Cherrypick commits from the temporary branch starting from the working base
const commits = yield git.revList([`${workingBase}..${tempBranch}`, '.'], ['--reverse']);
Expand Down
2 changes: 1 addition & 1 deletion src/create-or-update-branch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ export async function createOrUpdateBranch(
`Rebasing commits made to ${workingBaseType} '${workingBase}' on to base branch '${base}'`
)
// Checkout the actual base
await git.fetch([`${base}:${base}`], baseRemote, ['--force'])
await git.fetch([`${base}:${base}`], baseRemote, ['--force', '--depth=1'])
await git.checkout(base)
// Cherrypick commits from the temporary branch starting from the working base
const commits = await git.revList(
Expand Down

0 comments on commit 83b42f6

Please sign in to comment.