From accda7a7728705edf22e1935e34a6686752fc415 Mon Sep 17 00:00:00 2001 From: Davide Guerri Date: Fri, 6 Dec 2013 15:49:00 +0000 Subject: [PATCH] Fix crash when there are no local changes. Fixes a crash that occur if there are no local changes not present in the upstream branch. Change-Id: I0361865f144ce33a5a86f7d789a98639524fb0b2 JIRA: CICD-1041 --- ghp/commands/import_upstream.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ghp/commands/import_upstream.py b/ghp/commands/import_upstream.py index 1682ada..be99726 100644 --- a/ghp/commands/import_upstream.py +++ b/ghp/commands/import_upstream.py @@ -258,6 +258,10 @@ class ImportUpstream(LogDedentMixin, GitMixin): """Apply list of commits given onto latest import of upstream""" commit_list = list(strategy.filtered_iter()) + if len(commit_list) == 0: + self.log.notice("There are no local changes to be applied!") + return False + self.log.debug( """\ Should apply the following list of commits