Skip to content

Capture reference changes into a transaction in reference transaction hook

Sami Hiltunen requested to merge smh-support-multiple-ref-updates into master

Transactions perform their Git operations against their snapshots as described in Initial blueprint for transaction management in... (gitlab!122028 - merged). In order to commit the changes performed in the snapshot, we need to capture them. This MR wires transactions to the reference-transaction hook in order to do so. This is achieved by:

  1. Supporting multiple updates to a given reference during a transaction. This is necessary as some existing code may update a reference multiple times.
  2. Recording the initial reference value before the first update. This enables us to automatically figure out the reference's value at the beginning of the transaction as not all code paths provide that.
  3. Piping the transaction through to the reference-transaction hook and using the above two methods to record the changes.

With the changes recorded in the transaction, they can be eventually be committed with it.

Merge request reports