Skip to content

Commit

Permalink
force tryFetch (peter-evans#1189)
Browse files Browse the repository at this point in the history
  • Loading branch information
leeopop authored and aleksandrychev committed Mar 4, 2024
1 parent 92ee732 commit 966c994
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion dist/index.js
Expand Up @@ -62,7 +62,9 @@ exports.getWorkingBaseAndType = getWorkingBaseAndType;
function tryFetch(git, remote, branch) {
return __awaiter(this, void 0, void 0, function* () {
try {
yield git.fetch([`${branch}:refs/remotes/${remote}/${branch}`], remote);
yield git.fetch([`${branch}:refs/remotes/${remote}/${branch}`], remote, [
'--force'
]);
return true;
}
catch (_a) {
Expand Down
4 changes: 3 additions & 1 deletion src/create-or-update-branch.ts
Expand Up @@ -33,7 +33,9 @@ export async function tryFetch(
branch: string
): Promise<boolean> {
try {
await git.fetch([`${branch}:refs/remotes/${remote}/${branch}`], remote)
await git.fetch([`${branch}:refs/remotes/${remote}/${branch}`], remote, [
'--force'
])
return true
} catch {
return false
Expand Down

0 comments on commit 966c994

Please sign in to comment.