diff options
author | Ben Brown <ben.brown@codethink.co.uk> | 2017-08-21 16:54:20 +0100 |
---|---|---|
committer | Ben Brown <ben.brown@codethink.co.uk> | 2017-09-01 10:06:01 +0100 |
commit | 20848cb5c9e00d35177850ab7dabc0cc414e068a (patch) | |
tree | f360a8dea1421eef5a879352a97cb1a0b24074f2 /ybd | |
parent | ce9a751088e9aad687336b946540d50533d5b607 (diff) | |
download | ybd-20848cb5c9e00d35177850ab7dabc0cc414e068a.tar.gz |
Save tree entry for reuse
Diffstat (limited to 'ybd')
-rw-r--r-- | ybd/pots.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/ybd/pots.py b/ybd/pots.py index 6f09b70..90869a2 100644 --- a/ybd/pots.py +++ b/ybd/pots.py @@ -90,10 +90,11 @@ class Pots(object): for path in self._data: dn = self._data[path] sha1 = dn.get('sha', dn.get('ref')) - if sha1 and self._trees.get(path): - if sha1 == self._trees.get(path)[0]: - dn['sha'] = self._trees.get(path)[0] - dn['tree'] = self._trees.get(path)[1] + tree_entry = self._trees.get(path) + if sha1 and tree_entry: + if sha1 == tree_entry[0]: + dn['sha'] = tree_entry[0] + dn['tree'] = tree_entry[1] count += 1 log('DEFINITIONS', 'Re-used %s entries from .trees file' % count) except: |