Skip to content

Commit dc5d4e6

Browse files
committed
feature: add Discard all changes and Clear stashes to repository's command palette
This is because these two buttons are only avaliable in repository's sidebar. After we collapsed the sidebar, it is not convenient to run these two commands. Signed-off-by: leo <longshuang@msn.cn>
1 parent 081ac2e commit dc5d4e6

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎src/ViewModels/RepositoryCommandPalette.cs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,8 @@ public RepositoryCommandPalette(Repository repo)
7373
_cmds.Add(new("Push", "push", "Push", async () => await repo.PushAsync(false)));
7474
_cmds.Add(new("Stash.Title", "stash", "Stashes.Add", async () => await repo.StashAllAsync(false)));
7575
_cmds.Add(new("Apply.Title", "apply", "ApplyPatch", () => repo.ApplyPatch()));
76+
_cmds.Add(new("Repository.DiscardAll", "discard", "Undo", () => repo.DiscardAllChanges()));
77+
_cmds.Add(new("ClearStashes", "clear stashes", "RemoveAll", () => repo.ClearStashes()));
7678

7779
_cmds.Sort((l, r) => l.Label.CompareTo(r.Label));
7880
_visibleCmds = _cmds;

0 commit comments

Comments
 (0)