)]}'
{
  "commit": "681fabaeddd5c8595b8806749a431dfb7db7c981",
  "tree": "e00815858101c7af604341f6e32b07ee4706a4b9",
  "parents": [
    "f2f136ffe975cae93aac627929ba72ff013a1b42"
  ],
  "author": {
    "name": "Youssef Elghareeb",
    "email": "ghareeb@google.com",
    "time": "Mon Mar 14 19:15:41 2022 +0100"
  },
  "committer": {
    "name": "Youssef Elghareeb",
    "email": "ghareeb@google.com",
    "time": "Thu Apr 14 13:32:24 2022 +0000"
  },
  "message": "ChangeUpdate: fix updating change meta ref when the update is no/op\n\nThere was a bug in RemoveAttentionSetOp in the sense that it always\nreturned true signalling to callers to perform an update regardless of\nwhether the attention set will get updated or not.\n\nAt the time we build the change meta ref commit, we append all updates\nto the commit message. The method ChangeUpdate#isEmpty checks if there\nare no updates and bails out at [1]. Sometimes the variable\nplannedAttentionSetUpdates contained some updates, but this variable is\nprocessed in [2] while writing the commit message and in some cases no\nupdates are written after all. This triggered the creation of a new\ncommit in the change meta ref which is redundant, hence fixing in this\nchange and adapting the test in PostReviewIT to ensure the change meta\nref is not updated in this case.\n\nWe fix this by factoring out plannedAttentionSetUpdates from #isEmpty\nand explicitly checking that [2] did not include any attention set\nupdates. We do that because #isEmpty is also called from [3] in\nAbstractChangeUpdate#apply (at the beginning of the processing) and it\nbails out quickly if plannedAttentionSetUpdates is null.\n\n[1]\nhttps://gerrit.googlesource.com/gerrit/+/23678de2cdc56b676fcd80ea5d76b10af8c77304/java/com/google/gerrit/server/notedb/ChangeUpdate.java#1085\n\n[2]\nhttps://gerrit.googlesource.com/gerrit/+/23678de2cdc56b676fcd80ea5d76b10af8c77304/java/com/google/gerrit/server/notedb/ChangeUpdate.java#984\n\n[3]\nhttps://gerrit.googlesource.com/gerrit/+/23678de2cdc56b676fcd80ea5d76b10af8c77304/java/com/google/gerrit/server/notedb/AbstractChangeUpdate.java#220\n\nRelease-Notes: skip\nGoogle-Bug-Id: b/221124220\nChange-Id: I4086c614ff670e3bc43f772c3d004c65477db4eb\n(cherry picked from commit ecf033e5ef52eab3b0a8d4d6aef9d2799a467020)\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "45fd83d71ef927a073f5738ba90874b65c64a53c",
      "old_mode": 33188,
      "old_path": "java/com/google/gerrit/server/notedb/ChangeUpdate.java",
      "new_id": "8f352cb1bb2c869503a5714498a2abf56caa790e",
      "new_mode": 33188,
      "new_path": "java/com/google/gerrit/server/notedb/ChangeUpdate.java"
    },
    {
      "type": "modify",
      "old_id": "f8991b4dde3cc979fc5f3f42459a409fd81f3d38",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/acceptance/api/change/PostReviewIT.java",
      "new_id": "dcd8f77f94ee5ed5454e2ef64d0f5ff0d5c9792c",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/acceptance/api/change/PostReviewIT.java"
    },
    {
      "type": "modify",
      "old_id": "ab01bf3125da6abea3b327e079f15a2e9ffddc87",
      "old_mode": 33188,
      "old_path": "javatests/com/google/gerrit/server/query/change/AbstractQueryChangesTest.java",
      "new_id": "55c79216730ef04684fc05a0d2c328499423540b",
      "new_mode": 33188,
      "new_path": "javatests/com/google/gerrit/server/query/change/AbstractQueryChangesTest.java"
    }
  ]
}
