Git uncommit warning (#25977)

Adds a prompt when clicking the uncommit button when the current commit
is already present on a remote branch:

![screenshot showing
prompt](https://github.com/user-attachments/assets/d6421875-588e-4db0-aee0-a92f36bce94b)

Release Notes:

- N/A

---------

Co-authored-by: Conrad <conrad@zed.dev>
This commit is contained in:
Julia Ryan 2025-03-05 15:56:51 -08:00 committed by GitHub
parent 0200dda83d
commit e505d6bf5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 171 additions and 19 deletions

View file

@ -336,6 +336,9 @@ message Envelope {
GitGetBranches git_get_branches = 312;
GitCreateBranch git_create_branch = 313;
GitChangeBranch git_change_branch = 314; // current max
CheckForPushedCommits check_for_pushed_commits = 315;
CheckForPushedCommitsResponse check_for_pushed_commits_response = 316; // current max
}
reserved 87 to 88;
@ -2875,3 +2878,13 @@ message GitChangeBranch {
uint64 work_directory_id = 3;
string branch_name = 4;
}
message CheckForPushedCommits {
uint64 project_id = 1;
uint64 worktree_id = 2;
uint64 work_directory_id = 3;
}
message CheckForPushedCommitsResponse {
repeated string pushed_to = 1;
}

View file

@ -454,6 +454,8 @@ messages!(
(RemoteMessageResponse, Background),
(GitCreateBranch, Background),
(GitChangeBranch, Background),
(CheckForPushedCommits, Background),
(CheckForPushedCommitsResponse, Background),
);
request_messages!(
@ -598,6 +600,7 @@ request_messages!(
(Pull, RemoteMessageResponse),
(GitCreateBranch, Ack),
(GitChangeBranch, Ack),
(CheckForPushedCommits, CheckForPushedCommitsResponse),
);
entity_messages!(
@ -701,6 +704,7 @@ entity_messages!(
Pull,
GitChangeBranch,
GitCreateBranch,
CheckForPushedCommits,
);
entity_messages!(