]> review.fuel-infra Code Review - tools/sustaining.git/commitdiff
do not overengineer downstream branch creation 54/23254/1
authorAlex Ermolov <aermolov@mirantis.com>
Tue, 24 May 2016 18:06:24 +0000 (21:06 +0300)
committerAlex Ermolov <aermolov@mirantis.com>
Thu, 14 Jul 2016 09:58:04 +0000 (12:58 +0300)
Change-Id: I15b6c561fdfb2d3bf1672bdf57b094e61e6b20c3

jenkins/codesync/codesync.py

index 57e091b09902c4b04f11994c5a563f656483951e..cdd3848d304e9a45c139c29362636dc5e436dba8 100755 (executable)
@@ -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)