summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJürg Billeter <j@bitron.ch>2018-01-18 12:08:19 +0100
committerJürg Billeter <j@bitron.ch>2018-01-18 12:24:26 +0100
commitd759994ecb196b497c090fbf4d3be9642696b087 (patch)
treeea647e350a18868b87dbb771ee92d39e2f192575
parent88260c7a57f9c797af3f8222c02b257b25d25d45 (diff)
downloadbuildstream-d759994ecb196b497c090fbf4d3be9642696b087.tar.gz
source.py: Properly handle Source.track() returning None
Source.track() may return None when tracking is not available. Handle this identical to the case where track() returns the current ref. Fixes #201
-rw-r--r--buildstream/source.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/buildstream/source.py b/buildstream/source.py
index d43a57f1c..4882415f4 100644
--- a/buildstream/source.py
+++ b/buildstream/source.py
@@ -376,6 +376,10 @@ class Source(Plugin):
new_ref = self.track()
current_ref = self.get_ref()
+ if new_ref is None:
+ # No tracking, keep current ref
+ new_ref = current_ref
+
if current_ref != new_ref:
self.info("Found new revision: {}".format(new_ref))