aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/main/java/com/google/devtools/build/lib/flags
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/google/devtools/build/lib/flags')
-rw-r--r--src/main/java/com/google/devtools/build/lib/flags/InvocationPolicyEnforcer.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/flags/InvocationPolicyEnforcer.java b/src/main/java/com/google/devtools/build/lib/flags/InvocationPolicyEnforcer.java
index a61c432f0c..083cfb4930 100644
--- a/src/main/java/com/google/devtools/build/lib/flags/InvocationPolicyEnforcer.java
+++ b/src/main/java/com/google/devtools/build/lib/flags/InvocationPolicyEnforcer.java
@@ -255,10 +255,10 @@ public final class InvocationPolicyEnforcer {
setValue.getFlagValueList()));
} else {
- // Clear the value in case the flag is a repeated flag (so that values don't accumulate), and
- // in case the flag is an expansion flag or has implicit flags (so that the additional flags
- // also get cleared).
- parser.clearValue(flagName);
+ if (!setValue.getAppend()) {
+ // Clear the value in case the flag is a repeated flag so that values don't accumulate.
+ parser.clearValue(flagName);
+ }
// Set all the flag values from the policy.
for (String flagValue : setValue.getFlagValueList()) {