summaryrefslogtreecommitdiff
path: root/ybd
diff options
context:
space:
mode:
authorBen Brown <ben.brown@codethink.co.uk>2017-08-21 16:54:20 +0100
committerBen Brown <ben.brown@codethink.co.uk>2017-09-01 10:06:01 +0100
commit20848cb5c9e00d35177850ab7dabc0cc414e068a (patch)
treef360a8dea1421eef5a879352a97cb1a0b24074f2 /ybd
parentce9a751088e9aad687336b946540d50533d5b607 (diff)
downloadybd-20848cb5c9e00d35177850ab7dabc0cc414e068a.tar.gz
Save tree entry for reuse
Diffstat (limited to 'ybd')
-rw-r--r--ybd/pots.py9
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: