Package org.eclipse.jgit.transport
Class TrackingRefUpdate
- java.lang.Object
-
- org.eclipse.jgit.transport.TrackingRefUpdate
-
public class TrackingRefUpdate extends java.lang.Object
Update of a locally stored tracking branch.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
TrackingRefUpdate.Command
-
Field Summary
Fields Modifier and Type Field Description private ReceiveCommand
cmd
(package private) boolean
forceUpdate
(package private) java.lang.String
localName
(package private) ObjectId
newObjectId
(package private) ObjectId
oldObjectId
private java.lang.String
remoteName
private RefUpdate.Result
result
-
Constructor Summary
Constructors Constructor Description TrackingRefUpdate(boolean canForceUpdate, java.lang.String remoteName, java.lang.String localName, AnyObjectId oldValue, AnyObjectId newValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ReceiveCommand
asReceiveCommand()
Get this update wrapped by a ReceiveCommand.java.lang.String
getLocalName()
Get the name of the local tracking ref.ObjectId
getNewObjectId()
Get the new value the ref will be (or was) updated to.ObjectId
getOldObjectId()
The old value of the ref, prior to the update being attempted.java.lang.String
getRemoteName()
Get the name of the remote ref.RefUpdate.Result
getResult()
Get the status of this update.(package private) void
setResult(RefUpdate.Result result)
java.lang.String
toString()
-
-
-
Field Detail
-
remoteName
private final java.lang.String remoteName
-
localName
final java.lang.String localName
-
forceUpdate
boolean forceUpdate
-
oldObjectId
ObjectId oldObjectId
-
newObjectId
ObjectId newObjectId
-
result
private RefUpdate.Result result
-
cmd
private ReceiveCommand cmd
-
-
Constructor Detail
-
TrackingRefUpdate
TrackingRefUpdate(boolean canForceUpdate, java.lang.String remoteName, java.lang.String localName, AnyObjectId oldValue, AnyObjectId newValue)
-
-
Method Detail
-
getRemoteName
public java.lang.String getRemoteName()
Get the name of the remote ref.Usually this is of the form "refs/heads/master".
- Returns:
- the name used within the remote repository.
-
getLocalName
public java.lang.String getLocalName()
Get the name of the local tracking ref.Usually this is of the form "refs/remotes/origin/master".
- Returns:
- the name used within this local repository.
-
getNewObjectId
public ObjectId getNewObjectId()
Get the new value the ref will be (or was) updated to.- Returns:
- new value. Null if the caller has not configured it.
-
getOldObjectId
public ObjectId getOldObjectId()
The old value of the ref, prior to the update being attempted.This value may differ before and after the update method. Initially it is populated with the value of the ref before the lock is taken, but the old value may change if someone else modified the ref between the time we last read it and when the ref was locked for update.
- Returns:
- the value of the ref prior to the update being attempted.
-
getResult
public RefUpdate.Result getResult()
Get the status of this update.- Returns:
- the status of the update.
-
setResult
void setResult(RefUpdate.Result result)
-
asReceiveCommand
public ReceiveCommand asReceiveCommand()
Get this update wrapped by a ReceiveCommand.- Returns:
- this update wrapped by a ReceiveCommand.
- Since:
- 3.4
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-