ci: clear and mark MAKEFLAGS exported just once

Clearing it once upfront, and turning all the assignment into appending, would future-proof the code even more, to prevent mistakes the previous one fixed from happening again. Also, mark the variable exported just once at the beginning. There is no point in marking it exported repeatedly. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Feb 7, 2019 at 11:36 UTC a8c51f77d16d63aef9ee92df6ff5ddb006c38725
1 file changed +6 -3
ci/lib.sh
+6 -3
@@ -74,6 +74,9 @@ check_unignored_build_artifacts ()
74 }
75 }
76
77 +# Clear MAKEFLAGS that may come from the outside world.
78 +export MAKEFLAGS=
79 +
80 # Set 'exit on error' for all CI scripts to let the caller know that
81 # something went wrong.
82 # Set tracing executed commands, primarily setting environment variables
@@ -101,7 +104,7 @@ then
104 BREW_INSTALL_PACKAGES="git-lfs gettext"
105 export GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save"
106 export GIT_TEST_OPTS="--verbose-log -x --immediate"
104 - export MAKEFLAGS="--jobs=2"
107 + MAKEFLAGS="$MAKEFLAGS --jobs=2"
108 elif test -n "$SYSTEM_COLLECTIONURI" || test -n "$SYSTEM_TASKDEFINITIONSURI"
109 then
110 CI_TYPE=azure-pipelines
@@ -126,7 +129,7 @@ then
129 BREW_INSTALL_PACKAGES=gcc@8
130 export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save"
131 export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml"
129 - export MAKEFLAGS="--jobs=10"
132 + MAKEFLAGS="$MAKEFLAGS --jobs=10"
133 test windows_nt != "$CI_OS_NAME" ||
134 GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS"
135 else
@@ -185,4 +188,4 @@ GIT_TEST_GETTEXT_POISON)
188 ;;
189 esac
190
188 -export MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}"
191 +MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}"