From 8801c887e9ff7fd83cc246b7fce277a3efc4ea70 Mon Sep 17 00:00:00 2001 From: Michal Dorner Date: Mon, 8 Mar 2021 15:29:27 +0100 Subject: [PATCH] Do not try to update head of current branch --- dist/index.js | 2 +- src/git.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index da243b5..a16648d 100644 --- a/dist/index.js +++ b/dist/index.js @@ -3875,7 +3875,7 @@ async function getChangesSinceMergeBase(baseRef, ref, initialFetchDepth) { let lastCommitCount = await getCommitCount(); let depth = Math.max(lastCommitCount * 2, initialFetchDepth); while (!(await hasMergeBase())) { - await exec_1.default('git', ['fetch', `--depth=${depth}`, 'origin', `${baseRef}:${baseRef}`, `${ref}:${ref}`]); + await exec_1.default('git', ['fetch', `--depth=${depth}`, 'origin', `${baseRef}:${baseRef}`, `${ref}`]); const commitCount = await getCommitCount(); if (commitCount === lastCommitCount) { core.info('No more commits were fetched'); diff --git a/src/git.ts b/src/git.ts index 2cfa8ae..c58621f 100644 --- a/src/git.ts +++ b/src/git.ts @@ -69,7 +69,7 @@ export async function getChangesSinceMergeBase( let lastCommitCount = await getCommitCount() let depth = Math.max(lastCommitCount * 2, initialFetchDepth) while (!(await hasMergeBase())) { - await exec('git', ['fetch', `--depth=${depth}`, 'origin', `${baseRef}:${baseRef}`, `${ref}:${ref}`]) + await exec('git', ['fetch', `--depth=${depth}`, 'origin', `${baseRef}:${baseRef}`, `${ref}`]) const commitCount = await getCommitCount() if (commitCount === lastCommitCount) { core.info('No more commits were fetched')