summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorValentin David <valentin.david@codethink.co.uk>2019-05-10 14:34:04 +0200
committerValentin David <valentin.david@codethink.co.uk>2019-05-10 14:34:04 +0200
commit7f9dc4c84042d89bd3a3fc45a6b65ba4ccc8d338 (patch)
tree0a2c0d43f63acce404d0526dcb8d050211ce716d
parentcc871d37500cc78d16112cf31bf32685c3b7e9aa (diff)
downloadbuildstream-valentindavid/git-get-ref-warnings.tar.gz
buildstream/_gitsourcebase.py: Fix return of get_ref() when no ref is availablevalentindavid/git-get-ref-warnings
That was causing invalid warning. Fixes #1020.
-rw-r--r--buildstream/_gitsourcebase.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/buildstream/_gitsourcebase.py b/buildstream/_gitsourcebase.py
index 7d07c56cb..38c844c6a 100644
--- a/buildstream/_gitsourcebase.py
+++ b/buildstream/_gitsourcebase.py
@@ -469,7 +469,10 @@ class _GitSourceBase(Source):
self.mirror.tags = self._load_tags(node)
def get_ref(self):
- return self.mirror.ref, self.mirror.tags
+ if self.mirror.ref:
+ return self.mirror.ref, self.mirror.tags
+ else:
+ return None
def set_ref(self, ref_data, node):
if not ref_data: