diff --git a/core/commands/stash.py b/core/commands/stash.py index 23523b62f..e3f01f63c 100644 --- a/core/commands/stash.py +++ b/core/commands/stash.py @@ -17,11 +17,11 @@ def run(self, stash_id=None): else: self.do_apply(stash_id) - def do_apply(self, id): - if id == -1: + def do_apply(self, stash_id): + if stash_id is None: return - self.apply_stash(id) + self.apply_stash(stash_id) util.view.refresh_gitsavvy(self.window.active_view()) @@ -37,11 +37,11 @@ def run(self, stash_id=None): else: self.do_pop(stash_id) - def do_pop(self, id): - if id == -1: + def do_pop(self, stash_id): + if stash_id is None: return - self.pop_stash(id) + self.pop_stash(stash_id) util.view.refresh_gitsavvy(self.window.active_view()) @@ -59,12 +59,12 @@ def run(self, stash_ids=[]): for stash_id in stash_ids: self.do_show(stash_id) - def do_show(self, id): - if id == -1: + def do_show(self, stash_id): + if stash_id is None: return - stash_view = self.get_stash_view("stash@{{{}}}".format(id)) - stash_view.run_command("gs_replace_view_text", {"text": self.show_stash(id), "nuke_cursors": True}) + stash_view = self.get_stash_view("stash@{{{}}}".format(stash_id)) + stash_view.run_command("gs_replace_view_text", {"text": self.show_stash(stash_id), "nuke_cursors": True}) def get_stash_view(self, title): window = self.window if hasattr(self, "window") else self.view.window() @@ -129,11 +129,11 @@ def run(self, stash_id=None): else: self.do_drop(stash_id) - def do_drop(self, id): - if id == -1: + def do_drop(self, stash_id): + if stash_id is None: return @util.actions.destructive(description="drop a stash") - def do_drop_stash(id): - self.drop_stash(id) - do_drop_stash(id) + def do_drop_stash(stash_id): + self.drop_stash(stash_id) + do_drop_stash(stash_id) diff --git a/core/ui_mixins/quick_panel.py b/core/ui_mixins/quick_panel.py index 602c881d2..74a93d713 100644 --- a/core/ui_mixins/quick_panel.py +++ b/core/ui_mixins/quick_panel.py @@ -520,4 +520,4 @@ def __init__(self, on_done, **kwargs): super().__init__(self.get_stashes(), on_done, **kwargs) def format_item(self, entry): - return entry.id + " " + entry.description + return (entry.id + " " + entry.description, entry.id)