From 966c994bda9ce759655bb6e437ca68028a1d05de Mon Sep 17 00:00:00 2001 From: Keunhong Lee Date: Fri, 3 Jun 2022 17:30:50 +0900 Subject: [PATCH] force tryFetch (#1189) --- dist/index.js | 4 +++- src/create-or-update-branch.ts | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/dist/index.js b/dist/index.js index 2cfbc0c32..5bc8bf2e5 100644 --- a/dist/index.js +++ b/dist/index.js @@ -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) { diff --git a/src/create-or-update-branch.ts b/src/create-or-update-branch.ts index cfb60bc2a..460f43cd8 100644 --- a/src/create-or-update-branch.ts +++ b/src/create-or-update-branch.ts @@ -33,7 +33,9 @@ export async function tryFetch( branch: string ): Promise { 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