diff options
author | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2016-06-25 06:49:29 +0100 |
---|---|---|
committer | Paul Sherwood <paul.sherwood@codethink.co.uk> | 2016-06-25 06:49:29 +0100 |
commit | c3e1c98760c8a0e98c78ec0c4adca143259fc7e9 (patch) | |
tree | c5472e5e238e12c074ea01da08a033adb66c510d /ybd | |
parent | b81c8b352e4c2dd8746874370ace4534c4e15c9d (diff) | |
download | ybd-c3e1c98760c8a0e98c78ec0c4adca143259fc7e9.tar.gz |
Only save entries in .trees where ref: is a SHA
Diffstat (limited to 'ybd')
-rw-r--r-- | ybd/pots.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/ybd/pots.py b/ybd/pots.py index 370c4b9..cbf494e 100644 --- a/ybd/pots.py +++ b/ybd/pots.py @@ -90,8 +90,10 @@ class Pots(object): ''' for name in self._data: if self._data[name].get('tree') is not None: - self._trees[name] = [self._data[name]['ref'], - self._data[name]['tree'], - self._data[name].get('cache')] + if len(self._data[name]['ref']) == 40: + # only save tree entry for full SHA + self._trees[name] = [self._data[name]['ref'], + self._data[name]['tree'], + self._data[name].get('cache')] with open(os.path.join(config['artifacts'], '.trees'), 'w') as f: f.write(yaml.safe_dump(self._trees, default_flow_style=False)) |