Fix: Label update operation is executed as insert

When updating an existing label value with command like

 ssh -p 29418 user@review gerrit review <change>,<patchset> --label code-review=+1

where the lower case label name will make the update operation
become insert operation.  This causes an exception:

  "Unique index or primary key violation"

Use standard label name instead of lower case name.

Bug: Issue 2515
Change-Id: I735a5f84d0569554c050b60b8984ee83aa941d39
This commit is contained in:
Bruce Zu
2014-03-06 13:50:52 +08:00
committed by David Pursehouse
parent 68c530c610
commit 8479261b97

View File

@@ -431,7 +431,7 @@ public class PostReview implements RestModifyView<RevisionResource, Input> {
continue;
}
PatchSetApproval c = current.remove(name);
PatchSetApproval c = current.remove(lt.getName());
String normName = lt.getName();
if (ent.getValue() == null || ent.getValue() == 0) {
// User requested delete of this label.