git: Pick which remote to fetch (#26897)
I don't want to fetch `--all` branch, we should can picker which remote to fetch. Release Notes: - Added the `git::FetchFrom` action to fetch from a single remote. --------- Co-authored-by: Cole Miller <cole@zed.dev>
This commit is contained in:
parent
a40ee74a1f
commit
edd40566b7
9 changed files with 155 additions and 42 deletions
|
@ -59,7 +59,15 @@ pub fn init(cx: &mut App) {
|
|||
return;
|
||||
};
|
||||
panel.update(cx, |panel, cx| {
|
||||
panel.fetch(window, cx);
|
||||
panel.fetch(true, window, cx);
|
||||
});
|
||||
});
|
||||
workspace.register_action(|workspace, _: &git::FetchFrom, window, cx| {
|
||||
let Some(panel) = workspace.panel::<git_panel::GitPanel>(cx) else {
|
||||
return;
|
||||
};
|
||||
panel.update(cx, |panel, cx| {
|
||||
panel.fetch(false, window, cx);
|
||||
});
|
||||
});
|
||||
workspace.register_action(|workspace, _: &git::Push, window, cx| {
|
||||
|
@ -367,6 +375,7 @@ mod remote_button {
|
|||
el.context(keybinding_target.clone())
|
||||
})
|
||||
.action("Fetch", git::Fetch.boxed_clone())
|
||||
.action("Fetch From", git::FetchFrom.boxed_clone())
|
||||
.action("Pull", git::Pull.boxed_clone())
|
||||
.separator()
|
||||
.action("Push", git::Push.boxed_clone())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue