implement stash backend for git
This commit is contained in:
parent
802791e979
commit
4d62732ed5
|
@ -102,6 +102,13 @@ try:
|
|||
def ignore_event(path, name):
|
||||
return False
|
||||
|
||||
def stash(self):
|
||||
try:
|
||||
stashref = git.Repository(git_directory(self.directory)).lookup_reference('refs/stash')
|
||||
except KeyError:
|
||||
return 0
|
||||
return sum(1 for _ in stashref.log())
|
||||
|
||||
def do_status(self, directory, path):
|
||||
if path:
|
||||
try:
|
||||
|
@ -171,6 +178,9 @@ except ImportError:
|
|||
def _gitcmd(self, directory, *args):
|
||||
return readlines(('git',) + args, directory)
|
||||
|
||||
def stash(self):
|
||||
return sum(1 for _ in self._gitcmd(self.directory, 'stash', 'list'))
|
||||
|
||||
def do_status(self, directory, path):
|
||||
if path:
|
||||
try:
|
||||
|
|
Loading…
Reference in New Issue