Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Don't clobber the user's upstream settings (#26486)

Mikayla Makifd7ab20ea465
diff --git a/crates/git_ui/src/git_panel.rs b/crates/git_ui/src/git_panel.rs
index 50861c54fa9..2fd43867c47 100644
--- a/crates/git_ui/src/git_panel.rs
+++ b/crates/git_ui/src/git_panel.rs
@@ -1706,10 +1706,18 @@ impl GitPanel {
};
telemetry::event!("Git Pushed");
let branch = branch.clone();
+
let options = if force_push {
- PushOptions::Force
+ Some(PushOptions::Force)
} else {
- PushOptions::SetUpstream
+ match branch.upstream {
+ Some(Upstream {
+ tracking: UpstreamTracking::Gone,
+ ..
+ })
+ | None => Some(PushOptions::SetUpstream),
+ _ => None,
+ }
};
let remote = self.get_current_remote(window, cx);
@@ -1739,7 +1747,7 @@ impl GitPanel {
repo.push(
branch.name.clone(),
remote.name.clone(),
- Some(options),
+ options,
askpass_delegate,
cx,
)