diff options
author | Shawn Pearce <sop@google.com> | 2015-12-13 20:26:01 -0800 |
---|---|---|
committer | Shawn Pearce <sop@google.com> | 2015-12-14 09:18:27 -0800 |
commit | 4f8c993c494f1708eef264ca6e6e5193513ab51b (patch) | |
tree | 83b298de486c3fbb4cec30d8e0659da2e6792e90 /org.eclipse.jgit.pgm | |
parent | 3d8e6b1e16092701c31463092e945b8f00886bb7 (diff) | |
download | jgit-4f8c993c494f1708eef264ca6e6e5193513ab51b.tar.gz jgit-4f8c993c494f1708eef264ca6e6e5193513ab51b.zip |
push: Do not blindly overwrite peer
If an application uses PushConnection directly on the native Git wire
protocols JGit should send along the application's expected oldId, not
the advertised value. This allows the remote peer to compare-and-swap
since it was not tested inside JGit.
Discovered when I tried to use a PushConnection (bypassing the
standard PushProcess) and the client blindly overwrote the remote
reference, even though my app had supplied the wrong ObjectId for
the expectedOldObjectId. This was not expected and cost me over an
hour of debugging, plus "corruption" in the remote repository.
By passing along the exact expectedOldObjectId from the app the
remote side can do the check that the application skipped, and
avoid data loss.
Change-Id: Id3920837e6c47100376225bb4dd61fa3e88c64db
Diffstat (limited to 'org.eclipse.jgit.pgm')
0 files changed, 0 insertions, 0 deletions