diff options
author | Shawn Pearce <spearce@spearce.org> | 2014-04-18 14:03:20 -0700 |
---|---|---|
committer | Shawn Pearce <spearce@spearce.org> | 2014-04-18 14:03:20 -0700 |
commit | 911b1157725ec697036057b519071fd0e5c98fe2 (patch) | |
tree | e41bc5e793b06081be0d2cf62637c4f1f46ed1bf /org.eclipse.jgit | |
parent | c8dd915c45f4d0994ac2f8ffd779f27775120ab3 (diff) | |
download | jgit-911b1157725ec697036057b519071fd0e5c98fe2.tar.gz jgit-911b1157725ec697036057b519071fd0e5c98fe2.zip |
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
Diffstat (limited to 'org.eclipse.jgit')
-rw-r--r-- | org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java index 54b3066d88..1ef3fbf627 100644 --- a/org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java +++ b/org.eclipse.jgit/src/org/eclipse/jgit/transport/TrackingRefUpdate.java @@ -58,6 +58,7 @@ public class TrackingRefUpdate { private ObjectId newObjectId; private RefUpdate.Result result; + private ReceiveCommand cmd; TrackingRefUpdate( boolean canForceUpdate, @@ -130,8 +131,14 @@ public class TrackingRefUpdate { 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 { |