cvetriager: optional pull command
Small change to allow the pull command on a given branch to be executed
only if DO_PULL is changed to True. Tests don't need to be modified
because do_pull is mocked.
BUG=chromium:1093363
TEST=python setup.py test
Change-Id: I610de13c597d65d6c4922924458e11fc5d2f54c3
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/dev-util/+/2300009
Commit-Queue: Wanda Mora <morawand@chromium.org>
Tested-by: Wanda Mora <morawand@chromium.org>
Reviewed-by: Zubin Mithra <zsm@chromium.org>
diff --git a/contrib/cvetriager/cvelib/common.py b/contrib/cvetriager/cvelib/common.py
index d1c7b20..4a2d067 100644
--- a/contrib/cvetriager/cvelib/common.py
+++ b/contrib/cvetriager/cvelib/common.py
@@ -6,6 +6,8 @@
import subprocess
+DO_PULL = False
+
class CommonException(Exception):
"""Exception raised from common."""
@@ -31,7 +33,8 @@
def checkout_branch(kernel, branch, remote, remote_branch, kernel_path):
"""Checks into appropriate branch and keeps it up to date."""
do_checkout(kernel, branch, kernel_path)
- do_pull(kernel, remote, remote_branch, kernel_path)
+ if DO_PULL:
+ do_pull(kernel, remote, remote_branch, kernel_path)
def do_checkout(kernel, branch, kernel_path):