From: Alex Ermolov Date: Tue, 24 May 2016 18:06:24 +0000 (+0300) Subject: do not overengineer downstream branch creation X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=4e0d12c7d2af7cfffcdb73dd6d5566f9a1fe1bf8;p=tools%2Fsustaining.git do not overengineer downstream branch creation Change-Id: I15b6c561fdfb2d3bf1672bdf57b094e61e6b20c3 --- diff --git a/jenkins/codesync/codesync.py b/jenkins/codesync/codesync.py index 57e091b..cdd3848 100755 --- a/jenkins/codesync/codesync.py +++ b/jenkins/codesync/codesync.py @@ -148,26 +148,11 @@ def _merge_tip(repo, downstream_branch, upstream_branch): local_downstream_branch = '/'.join(downstream_branch.split('/')[1:]) - if local_branch_exists(repo, local_downstream_branch): - # cleanup local branch - subprocess.check_call( - ['git', 'checkout', 'master'], - cwd=repo, - stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) - subprocess.check_call( - ['git', 'branch', '-D', local_downstream_branch], - cwd=repo, - stdout=subprocess.PIPE, stderr=subprocess.PIPE - ) - subprocess.check_call( - ['git', 'checkout', '-b', local_downstream_branch, - downstream_branch], + ['git', 'checkout', downstream_branch], cwd=repo, stdout=subprocess.PIPE, stderr=subprocess.PIPE ) - try: m = _get_merge_commit_message(repo, downstream_branch, upstream_branch) LOG.info('Commit message:\n\n%s\n\n', m)