Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add force option to tryFetch #1189

Merged
merged 1 commit into from Jun 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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