]> source.dussan.org Git - jgit.git/commit
Expose ReceiveCommand.updateType to check for UPDATE_NONFASTFORWARD 85/6085/1
authorShawn O. Pearce <spearce@spearce.org>
Tue, 22 May 2012 23:22:41 +0000 (16:22 -0700)
committerShawn O. Pearce <spearce@spearce.org>
Tue, 22 May 2012 23:28:34 +0000 (16:28 -0700)
commitd8d649a43eb6b72f97979112066378748d0cabaf
treed2e0ef070667bd97460db3cb9b93c96925c3a182
parent04fa307a70f8bc4f47a95fb18f74b0c9763d059b
Expose ReceiveCommand.updateType to check for UPDATE_NONFASTFORWARD

When a command's type is UPDATE, JGit might not yet be sure if it
is a fast-forward or not. Expose a utility method to compute the
exact type by performing the merge base test, allowing the type
to be switched to UPDATE_NONFASTFORWARD if old ObjectId is not
contained in new ObjectId.

BaseReceivePack already does this test when validating the incoming
command list, so provide a package level backdoor to set the type
and avoid needing to redo the merge test later.

Change-Id: If5a6fcc50dc4d6f96e9bb0bb7bba15ebe8b86377
org.eclipse.jgit/src/org/eclipse/jgit/transport/BaseReceivePack.java
org.eclipse.jgit/src/org/eclipse/jgit/transport/ReceiveCommand.java