]> source.dussan.org Git - jgit.git/commit
Push: Ensure ref updates are processed in input order 87/121087/4
authorDave Borowitz <dborowitz@google.com>
Thu, 12 Apr 2018 15:43:50 +0000 (11:43 -0400)
committerDave Borowitz <dborowitz@google.com>
Fri, 13 Apr 2018 08:21:43 +0000 (04:21 -0400)
commit29fc7e87c6c961605825e3d15c69ad11d8f33e51
tree3a6a4b0a43284cedca0e071ad5440bb7b1bf63c6
parente5ba2c9bdae8c0a18ae9b5b8e5f255aae254b864
Push: Ensure ref updates are processed in input order

Various places on the client side of the push were creating unordered
maps and sets of ref names, resulting in ReceivePack processing commands
in an order other than what the client provided. This is normally not
problematic for clients, who don't typically care about the order in
which ref updates are applied to the storage layer.

However, it does make it difficult to write deterministic tests of
ReceivePack or hooks whose output depends on the order in which commands
are processed, for example if informational per-ref messages are written
to a sideband.[1]

Add a test that ensures the ordering of commands both internally in
ReceivePack and in the output PushResult.

[1] Real-world example:
    https://gerrit-review.googlesource.com/c/gerrit/+/171871/1/javatests/com/google/gerrit/acceptance/git/PushPermissionsIT.java#149

Change-Id: I7f1254b4ebf202d4dcfc8e59d7120427542d0d9e
org.eclipse.jgit.test/tst/org/eclipse/jgit/transport/PushConnectionTest.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/PushProcess.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/Transport.java