Skip to content

Commit

Permalink
stash: fix StashIndex and SaveStash
Browse files Browse the repository at this point in the history
The stash command super classes needed to be updated to ContextCommand.

Closes #847
Reported-by: 林博仁 (Buo-ren Lin)
Signed-off-by: David Aguilar <davvid@gmail.com>
  • Loading branch information
davvid committed Jun 30, 2018
1 parent 49e87e7 commit 5832ed2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 2 additions & 8 deletions cola/models/stash.py
Expand Up @@ -45,12 +45,6 @@ def stash_diff(self, rev):
return diffstat + '\n\n' + diff


class CommandMixin(object):

def is_undoable(self):
return False


class ApplyStash(cmds.ContextCommand):

def __init__(self, context, stash_index, index, pop):
Expand Down Expand Up @@ -97,7 +91,7 @@ def do(self):
title, 'git stash drop ' + self.stash_ref, status, out, err)


class SaveStash(CommandMixin):
class SaveStash(cmds.ContextCommand):

def __init__(self, context, stash_name, keep_index):
super(SaveStash, self).__init__(context)
Expand All @@ -119,7 +113,7 @@ def do(self):
title, 'git stash ' + cmdargs, status, out, err)


class StashIndex(CommandMixin):
class StashIndex(cmds.ContextCommand):
"""Stash the index away"""

def __init__(self, context, stash_name):
Expand Down
4 changes: 4 additions & 0 deletions share/doc/git-cola/relnotes.rst
Expand Up @@ -70,6 +70,10 @@ Packaging

Fixes
-----
* A regression when saving stashes was fixed.

https://github.com/git-cola/git-cola/issues/847

* Diffing image files was not updating the available context menus,
which prevented the "Stage" action from being present in the menu.

Expand Down

0 comments on commit 5832ed2

Please sign in to comment.