summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2019-10-31 17:45:56 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2019-11-01 10:43:57 +0000
commit22483d0fbd839996617834866c24edc4c196095e (patch)
treeeaed38728f84e41301019a0724e9b22256e91e1d
parent2bb3dc154da08be47e769b4cceabbc7fc60cbf44 (diff)
downloadbuildstream-bschubert/fix-git-ref.tar.gz
_gitsourcebase.py: Return 'None' when the ref is unsetbschubert/fix-git-ref
As per the documentation, sources are required to return 'None' when their ref is unset.
-rw-r--r--src/buildstream/_gitsourcebase.py2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/buildstream/_gitsourcebase.py b/src/buildstream/_gitsourcebase.py
index 68eb4c2fb..120d8c72a 100644
--- a/src/buildstream/_gitsourcebase.py
+++ b/src/buildstream/_gitsourcebase.py
@@ -471,6 +471,8 @@ class _GitSourceBase(Source):
self.mirror.tags = self._load_tags(node)
def get_ref(self):
+ if self.mirror.ref is None:
+ return None
return self.mirror.ref, self.mirror.tags
def set_ref(self, ref, node):