From df0e24319d7bf5903be5bbad5134dfa48c6aa653 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Wed, 1 Aug 2018 17:19:31 +0200 Subject: [PATCH] Fix SnapshotProvider failing on taking_snapshot without changes --- lib/tfw/components/snapshot_provider.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/tfw/components/snapshot_provider.py b/lib/tfw/components/snapshot_provider.py index 3623f0e..aa9bb1f 100644 --- a/lib/tfw/components/snapshot_provider.py +++ b/lib/tfw/components/snapshot_provider.py @@ -66,10 +66,14 @@ class SnapshotProvider: 'git', 'add', '-A' )) - self._run(( - 'git', 'commit', - '-m', 'Snapshot' - )) + try: + self._get_stdout(( + 'git', 'commit', + '-m', 'Snapshot' + )) + except CalledProcessError as err: + if b'nothing to commit, working tree clean' not in err.output: + raise def _check_head_not_detached(self): if self._head_detached: