Don't require 'commit' attribute in merge event

Problem occurs when merge events for periodic pipeline
are processed: first, a trivial mistake in type checking
introduced in review 243493,
second, merge events generated for NullChange's are repo updates,
and don't provide 'commit' attribute.
I don't see the necessity to enforce 'build_set.commit' to be set
(which is given to job env ZUUL_COMMIT if 'ref' or 'refspec' are set,
but that's not the case for NullChange)

Change-Id: Ib5da4ba987898d37d8e5082f4b8e2a5c31910323
This commit is contained in:
Evgeny Antyshev 2016-01-25 14:44:21 +00:00
parent 514db293af
commit b078bb4850
1 changed files with 2 additions and 2 deletions

View File

@ -1577,9 +1577,9 @@ class BasePipelineManager(object):
if event.merged:
build_set.commit = event.commit
elif event.updated:
if not isinstance(item, NullChange):
if not isinstance(item.change, NullChange):
build_set.commit = item.change.newrev
if not build_set.commit:
if not build_set.commit and not isinstance(item.change, NullChange):
self.log.info("Unable to merge change %s" % item.change)
self.pipeline.setUnableToMerge(item)