From e1fcc5546f005b4f74110ec483f813d5359d9a30 Mon Sep 17 00:00:00 2001 From: Nikita Galaiko Date: Thu, 19 Oct 2023 13:41:42 +0200 Subject: [PATCH] show force push when upstream commits present --- .../src/routes/repo/[projectId]/BranchLane.svelte | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/packages/ui/src/routes/repo/[projectId]/BranchLane.svelte b/packages/ui/src/routes/repo/[projectId]/BranchLane.svelte index 99960a242..58df703dc 100644 --- a/packages/ui/src/routes/repo/[projectId]/BranchLane.svelte +++ b/packages/ui/src/routes/repo/[projectId]/BranchLane.svelte @@ -114,13 +114,10 @@ } } - function push() { - if (localCommits[0]?.id) { - isPushing = true; - return branchController - .pushBranch({ branchId: branch.id, withForce: branch.requiresForce }) - .finally(() => (isPushing = false)); - } + async function push() { + isPushing = true; + await branchController.pushBranch({ branchId: branch.id, withForce: branch.requiresForce }); + isPushing = false; } function merge() { @@ -552,7 +549,7 @@ {#if branch.commits.length > 0}
- {#if localCommits.length > 0} + {#if localCommits.length > 0 || (branch.upstream && branch.upstream.commits.length > 0)}