Skip to content

Commit

Permalink
Update with merge commitbutton does not go away despite merging (#5702
Browse files Browse the repository at this point in the history
)

Fixes #5661
  • Loading branch information
alexr00 committed Feb 1, 2024
1 parent 7c8ca22 commit 88c0c32
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/github/pullRequestOverview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -825,6 +825,7 @@ export class PullRequestOverviewPanel extends IssueOverviewPanel<PullRequestMode
return this._replyMessage(message, {});
}
await this._folderRepositoryManager.tryMergeBaseIntoHead(this._item, true);
await this.refreshPanel();

this._replyMessage(message, {});
}
Expand Down
7 changes: 6 additions & 1 deletion webviews/components/merge.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -246,14 +246,19 @@ export const MergeStatus = ({ mergeable, isSimple, isCurrentlyCheckedOut, canUpd

export const OfferToUpdate = ({ mergeable, isSimple, isCurrentlyCheckedOut, canUpdateBranch }: { mergeable: PullRequestMergeability; isSimple: boolean; isCurrentlyCheckedOut: boolean, canUpdateBranch: boolean }) => {
const { updateBranch } = useContext(PullRequestContext);
const [isBusy, setBusy] = useState(false);
const update = () => {
setBusy(true);
updateBranch().finally(() => setBusy(false));
}
if (!canUpdateBranch || !isCurrentlyCheckedOut || isSimple || mergeable === PullRequestMergeability.Behind || mergeable === PullRequestMergeability.Conflict || mergeable === PullRequestMergeability.Unknown) {
return null;
}
return (
<div className="status-item status-section">
{alertIcon}
<p>This branch is out-of-date with the base branch.</p>
<button className="secondary" onClick={updateBranch} >Update with merge commit</button>
<button className="secondary" onClick={update} disabled={isBusy} >Update with merge commit</button>
</div>
);

Expand Down

0 comments on commit 88c0c32

Please sign in to comment.