Top Description Fields Constructors Methods
org.eclipse.jgit.lib

public abstract Class RefRename

extends Object
Class Inheritance
Known Direct Subclasses
org.eclipse.jgit.internal.storage.dfs.DfsRefRename, org.eclipse.jgit.internal.storage.file.FileReftableDatabase.FileRefRename, org.eclipse.jgit.internal.storage.file.RefDirectoryRename
Imports
java.io.IOException, org.eclipse.jgit.lib.RefUpdate.Result

A RefUpdate combination for renaming a reference.

If the source reference is currently pointed to by HEAD, then the HEAD symbolic reference is updated to point to the new destination.

Field Summary

Modifier and TypeField and Description
protected final RefUpdate
destination

Update operation to create/overwrite the destination reference.

private RefUpdate.Result
protected final RefUpdate
source

Update operation to read and delete the source reference.

Constructor Summary

AccessConstructor and Description
protected
RefRename(RefUpdate
operation to read and delete the source.
src
,
RefUpdate
operation to create (or overwrite) the destination.
dst
)

Initialize a new rename operation.

Method Summary

Modifier and TypeMethod and Description
public void
disableRefLog()

Don't record this rename in the ref's associated reflog.

protected abstract RefUpdate.Result

Returns:

the result of the rename operation.
doRename
()

Do the actual rename

public PersonIdent

Returns:

identity of the user making the change in the reflog.
getRefLogIdent
()

Get identity of the user making the change in the reflog.

public String

Returns:

message the caller wants to include in the reflog; null if the rename should not be logged.
getRefLogMessage
()

Get the message to include in the reflog.

public RefUpdate.Result

Returns:

result of rename operation
getResult
()

Get result of rename operation

protected boolean

Returns:

true if the Constants#HEAD reference needs to be linked to the new destination name.
needToUpdateHEAD
()

Whether the Constants#HEAD reference needs to be linked to the new destination name.

public RefUpdate.Result

Returns:

the result of the new ref update
rename
()

Rename

public void
setRefLogIdent(PersonIdent
identity of the user. If null the identity will be automatically determined based on the repository configuration.
pi
)

Set the identity of the user appearing in the reflog.

public void
setRefLogMessage(String
the message to describe this change.
msg
)

Set the message to include in the reflog.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

destinationback to summary
protected final RefUpdate destination

Update operation to create/overwrite the destination reference.

resultback to summary
private RefUpdate.Result result
sourceback to summary
protected final RefUpdate source

Update operation to read and delete the source reference.

Constructor Detail

RefRenameback to summary
protected RefRename(RefUpdate src, RefUpdate dst)

Initialize a new rename operation.

Parameters
src:RefUpdate

operation to read and delete the source.

dst:RefUpdate

operation to create (or overwrite) the destination.

Method Detail

disableRefLogback to summary
public void disableRefLog()

Don't record this rename in the ref's associated reflog.

doRenameback to summary
protected abstract RefUpdate.Result doRename() throws IOException

Do the actual rename

Returns:RefUpdate.Result

the result of the rename operation.

Exceptions
IOException:
if an IO error occurred
getRefLogIdentback to summary
public PersonIdent getRefLogIdent()

Get identity of the user making the change in the reflog.

Returns:PersonIdent

identity of the user making the change in the reflog.

getRefLogMessageback to summary
public String getRefLogMessage()

Get the message to include in the reflog.

Returns:String

message the caller wants to include in the reflog; null if the rename should not be logged.

getResultback to summary
public RefUpdate.Result getResult()

Get result of rename operation

Returns:RefUpdate.Result

result of rename operation

needToUpdateHEADback to summary
protected boolean needToUpdateHEAD() throws IOException

Whether the Constants#HEAD reference needs to be linked to the new destination name.

Returns:boolean

true if the Constants#HEAD reference needs to be linked to the new destination name.

Exceptions
IOException:
the current value of HEAD cannot be read.
renameback to summary
public RefUpdate.Result rename() throws IOException

Rename

Returns:RefUpdate.Result

the result of the new ref update

Exceptions
IOException:
if an IO error occurred
setRefLogIdentback to summary
public void setRefLogIdent(PersonIdent pi)

Set the identity of the user appearing in the reflog.

The timestamp portion of the identity is ignored. A new identity with the current timestamp will be created automatically when the rename occurs and the log record is written.

Parameters
pi:PersonIdent

identity of the user. If null the identity will be automatically determined based on the repository configuration.

setRefLogMessageback to summary
public void setRefLogMessage(String msg)

Set the message to include in the reflog.

Parameters
msg:String

the message to describe this change.