Fix an expansion flag issue where it expands to a repeatable flag.

There's no reason an expansion flag should not expand to multiple values for a repeatable flag (a flag with allowMultiple set to true.) If this expansion flag is set in a SetValue policy, group its repeatable subflags into a single SetValue per subflag.

For an overridable SetValue policy on an expansion, any repeatable flag that it expands to should append its value, and not override the user's original values.

PiperOrigin-RevId: 153233784
diff --git a/src/test/java/com/google/devtools/build/lib/runtime/TestOptions.java b/src/test/java/com/google/devtools/build/lib/runtime/TestOptions.java
index 1298392..f5c2a85 100644
--- a/src/test/java/com/google/devtools/build/lib/runtime/TestOptions.java
+++ b/src/test/java/com/google/devtools/build/lib/runtime/TestOptions.java
@@ -132,6 +132,23 @@
   public String expandedD;
 
   /*
+   * Expansion into repeatable flags.
+   */
+
+  public static final String EXPANDED_MULTIPLE_1 = "expandedFirstValue";
+  public static final String EXPANDED_MULTIPLE_2 = "expandedSecondValue";
+
+  @Option(name = "test_expansion_to_repeatable",
+      defaultValue = "null",
+      expansion = {
+          "--test_multiple_string=expandedFirstValue",
+          "--test_multiple_string=expandedSecondValue"
+      }
+  )
+  public Void testExpansionToRepeatable;
+
+
+  /*
    * Implicit requirement flags
    */