Improve handling of first CI run for new branch. (#29070)

This commit is contained in:
Matt Clay 2017-09-06 16:40:04 -07:00 committed by Toshio Kuratomi
parent fe3b4325c2
commit a1453a7917
2 changed files with 9 additions and 3 deletions

View file

@ -74,8 +74,8 @@ class ShippableChanges(object):
self.paths = sorted(git.get_diff_names([last_successful_commit, self.commit]))
self.diff = git.get_diff([last_successful_commit, self.commit])
else:
# tracked files (including unchanged)
self.paths = sorted(git.get_file_names(['--cached']))
# first run for branch
self.paths = None # act as though change detection not enabled, do not filter targets
self.diff = []
def get_merge_runs(self, project_id, branch):
@ -117,6 +117,9 @@ class ShippableChanges(object):
if git.is_valid_ref(commit_sha):
last_successful_commit = commit_sha
if last_successful_commit is None:
display.warning('No successful commit found. All tests will be executed.')
return last_successful_commit