Skip to content

Commit

Permalink
Merge branch 'fix-talkative-snapshot'
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcus Rosenow authored and Marcus Rosenow committed Aug 11, 2015
2 parents e8196e9 + 23b2327 commit a9f9271
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/commands/snapshot.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Create a snapshot of the changes in a dirty working directory."""

from subprocess import call, check_output
import os
from subprocess import call, check_output, STDOUT

from utils.messages import info

Expand All @@ -16,6 +17,9 @@ def snapshot(message):
stash_command = stash_command if message is None else stash_command + [message]

call(stash_command)
call(['git', 'stash', 'apply', '--quiet'])

# apply isn't completely quiet when the stash only contains untracked files so swallow all output
with open(os.devnull, 'w') as devnull:
call(['git', 'stash', 'apply', '--quiet'], stdout=devnull, stderr=STDOUT)
else:
info('No local changes to save. No snapshot created.')

0 comments on commit a9f9271

Please sign in to comment.