Skip to content

Commit a8c51f7

Browse files
committed
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 <[email protected]>
1 parent 406f93a commit a8c51f7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

ci/lib.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ check_unignored_build_artifacts ()
7474
}
7575
}
7676

77+
# Clear MAKEFLAGS that may come from the outside world.
78+
export MAKEFLAGS=
79+
7780
# Set 'exit on error' for all CI scripts to let the caller know that
7881
# something went wrong.
7982
# Set tracing executed commands, primarily setting environment variables
@@ -101,7 +104,7 @@ then
101104
BREW_INSTALL_PACKAGES="git-lfs gettext"
102105
export GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save"
103106
export GIT_TEST_OPTS="--verbose-log -x --immediate"
104-
export MAKEFLAGS="--jobs=2"
107+
MAKEFLAGS="$MAKEFLAGS --jobs=2"
105108
elif test -n "$SYSTEM_COLLECTIONURI" || test -n "$SYSTEM_TASKDEFINITIONSURI"
106109
then
107110
CI_TYPE=azure-pipelines
@@ -126,7 +129,7 @@ then
126129
BREW_INSTALL_PACKAGES=gcc@8
127130
export GIT_PROVE_OPTS="--timer --jobs 10 --state=failed,slow,save"
128131
export GIT_TEST_OPTS="--verbose-log -x --write-junit-xml"
129-
export MAKEFLAGS="--jobs=10"
132+
MAKEFLAGS="$MAKEFLAGS --jobs=10"
130133
test windows_nt != "$CI_OS_NAME" ||
131134
GIT_TEST_OPTS="--no-chain-lint --no-bin-wrappers $GIT_TEST_OPTS"
132135
else
@@ -185,4 +188,4 @@ GIT_TEST_GETTEXT_POISON)
185188
;;
186189
esac
187190

188-
export MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}"
191+
MAKEFLAGS="$MAKEFLAGS CC=${CC:-cc}"

0 commit comments

Comments
 (0)