Returns the id and msg of the stash that matches the given pattern.
(pattern)
| 1313 | # Helpers for stashing |
| 1314 | |
| 1315 | def _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 | |
| 1327 | def _stash_msg(name): |
| 1328 | return '---gl-{0}---'.format(name) |
no test coverage detected