git_panel: Improve toast messages for push/pull/fetch (#35092)

On GitLab, when pushing a branch and a MR already existing the remote
log contains "View merge request" and the link to the MR.

Fixed `Already up to date` stdout check on pull (was `Everything up to
date` on stderr)
Fixed `Everything up-to-date` check on push (was `Everything up to
date`)
Improved messaging for up-to-date for fetch/push/pull
Fixed tests introduced in
https://github.com/zed-industries/zed/pull/33833.

<img width="470" height="111" alt="Screenshot 2025-07-31 at 18 37 05"
src="https://github.com/user-attachments/assets/2a5dcc4c-6f53-4a85-b983-8e25149efcc0"
/>

Release Notes:

- Git UI: Add "View Pull Request" when pushing to Gitlab remotes
- git: Improved toast messages on fetch/push/pull

---------

Co-authored-by: Peter Tripp <peter@zed.dev>
This commit is contained in:
Guillaume Launay 2025-08-05 00:20:20 +02:00 committed by GitHub
parent 24e7f868ad
commit 182edbf526
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 95 additions and 65 deletions

View file

@ -2899,7 +2899,9 @@ impl GitPanel {
let status_toast = StatusToast::new(message, cx, move |this, _cx| {
use remote_output::SuccessStyle::*;
match style {
Toast { .. } => this,
Toast { .. } => {
this.icon(ToastIcon::new(IconName::GitBranchSmall).color(Color::Muted))
}
ToastWithLog { output } => this
.icon(ToastIcon::new(IconName::GitBranchSmall).color(Color::Muted))
.action("View Log", move |window, cx| {
@ -2912,9 +2914,9 @@ impl GitPanel {
})
.ok();
}),
PushPrLink { link } => this
PushPrLink { text, link } => this
.icon(ToastIcon::new(IconName::GitBranchSmall).color(Color::Muted))
.action("Open Pull Request", move |_, cx| cx.open_url(&link)),
.action(text, move |_, cx| cx.open_url(&link)),
}
});
workspace.toggle_status_toast(status_toast, cx)