Browse Source

Expose ReceiveCommand version of TrackingRefUpdate

If the caller uses a BatchRefUpdate to execute these (e.g. fetch)
there may be more detailed status information inside of the command
that was used to execute it. Allow the caller to obtain that status
data from the ReceiveCommand version of the TrackingRefUpdate.

Change-Id: I47209377fb8fcef0346d7678f1ab27f4790b49bc
stable-3.4
Shawn Pearce 11 years ago
parent
commit
911b115772
  1. 11
      org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java

11
org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java

@ -58,6 +58,7 @@ public class TrackingRefUpdate {
private ObjectId newObjectId; private ObjectId newObjectId;
private RefUpdate.Result result; private RefUpdate.Result result;
private ReceiveCommand cmd;
TrackingRefUpdate( TrackingRefUpdate(
boolean canForceUpdate, boolean canForceUpdate,
@ -130,8 +131,14 @@ public class TrackingRefUpdate {
this.result = result; this.result = result;
} }
ReceiveCommand asReceiveCommand() { /**
return new Command(); * @return this update wrapped by a ReceiveCommand.
* @since 3.4
*/
public ReceiveCommand asReceiveCommand() {
if (cmd == null)
cmd = new Command();
return cmd;
} }
final class Command extends ReceiveCommand { final class Command extends ReceiveCommand {

Loading…
Cancel
Save