[autobuilder-helper,warrior,25/41] scripts/send-qa-email: fix bug in git push logic for yocto-testresults

Submitted by Richard Purdie on Sept. 10, 2020, 12:25 p.m. | Patch ID: 176306

Details

Message ID 20200910122553.2040430-25-richard.purdie@linuxfoundation.org
State New
Headers show

Commit Message

Richard Purdie Sept. 10, 2020, 12:25 p.m.
From: Steve Sakoman <steve@sakoman.com>

We were mistakenly doing a force push if the branch was in either
BUILD_HISTORY_FORKPUSH or BUILD_HISTORY_DIRECTPUSH.

Now we force push for branches in BUILD_HISTORY_FORKPUSH, regular push
for branches in BUILD_HISTORY_DIRECTPUSH, and no push if the branch is
in neither list.

Signed-off-by: Steve Sakoman <steve@sakoman.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
---
 scripts/send-qa-email | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Patch hide | download patch | download mbox

diff --git a/scripts/send-qa-email b/scripts/send-qa-email
index 7dbc290..a265a7c 100755
--- a/scripts/send-qa-email
+++ b/scripts/send-qa-email
@@ -77,10 +77,10 @@  if 'poky' in repos and os.path.exists(resulttool) and args.results_dir:
                 extraopts = None
 
         subprocess.check_call([resulttool, "store", args.results_dir, tempdir])
-        if basebranch:
+        if comparebranch:
             subprocess.check_call(["git", "push", "--all", "--force"], cwd=tempdir)
             subprocess.check_call(["git", "push", "--tags", "--force"], cwd=tempdir)
-        else:
+        elif basebranch:
             subprocess.check_call(["git", "push", "--all"], cwd=tempdir)
             subprocess.check_call(["git", "push", "--tags"], cwd=tempdir)