MCPcopy
hub / github.com/gitless-vcs/gitless / _stash

Function _stash

gitless/core.py:1315–1325  ·  view source on GitHub ↗

Returns the id and msg of the stash that matches the given pattern.

(pattern)

Source from the content-addressed store, hash-verified

1313# Helpers for stashing
1314
1315def _stash(pattern):
1316 """Returns the id and msg of the stash that matches the given pattern."""
1317 out = stdout(git.stash.list(grep=pattern, format='|*|%gd|*|%B|*|'))
1318 if not out:
1319 return None, None
1320
1321 result = re.match(r'\|\*\|(stash@\{.+\})\|\*\|(.*)\|\*\|', out, re.DOTALL)
1322 if not result:
1323 raise GlError('Unexpected output of git stash: {0}'.format(out))
1324
1325 return result.group(1).strip(), result.group(2).strip()
1326
1327def _stash_msg(name):
1328 return '---gl-{0}---'.format(name)

Callers 3

restoreMethod · 0.85
deleteMethod · 0.85
_safe_restoreMethod · 0.85

Calls 2

GlErrorClass · 0.85
stdoutFunction · 0.70

Tested by

no test coverage detected