public abstract class RefRename extends Object
If the source reference is currently pointed to by HEAD
, then the
HEAD symbolic reference is updated to point to the new destination.
Modifier and Type | Field and Description |
---|---|
protected RefUpdate |
destination
Update operation to create/overwrite the destination reference.
|
protected RefUpdate |
source
Update operation to read and delete the source reference.
|
Modifier | Constructor and Description |
---|---|
protected |
RefRename(RefUpdate src,
RefUpdate dst)
Initialize a new rename operation.
|
Modifier and Type | Method and Description |
---|---|
void |
disableRefLog()
Don't record this rename in the ref's associated reflog.
|
protected abstract RefUpdate.Result |
doRename()
Do the actual rename
|
PersonIdent |
getRefLogIdent()
Get identity of the user making the change in the reflog.
|
String |
getRefLogMessage()
Get the message to include in the reflog.
|
RefUpdate.Result |
getResult()
Get result of rename operation
|
protected boolean |
needToUpdateHEAD()
Whether the
Constants#HEAD reference needs to be linked to the
new destination name. |
RefUpdate.Result |
rename()
Rename
|
void |
setRefLogIdent(PersonIdent pi)
Set the identity of the user appearing in the reflog.
|
void |
setRefLogMessage(String msg)
Set the message to include in the reflog.
|
protected final RefUpdate source
protected final RefUpdate destination
public PersonIdent getRefLogIdent()
public void setRefLogIdent(PersonIdent pi)
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.
pi
- identity of the user. If null the identity will be
automatically determined based on the repository
configuration.public String getRefLogMessage()
public void setRefLogMessage(String msg)
msg
- the message to describe this change.public void disableRefLog()
public RefUpdate.Result getResult()
public RefUpdate.Result rename() throws IOException
IOException
protected abstract RefUpdate.Result doRename() throws IOException
IOException
protected boolean needToUpdateHEAD() throws IOException
Constants#HEAD
reference needs to be linked to the
new destination name.Constants#HEAD
reference needs to be linked
to the new destination name.IOException
- the current value of HEAD
cannot be read.Copyright © 2019 Eclipse JGit Project. All rights reserved.