public class ReflogWriter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
forceWrite |
private RefDirectory |
refdb |
Constructor and Description |
---|
ReflogWriter(RefDirectory refdb)
Create writer for ref directory.
|
ReflogWriter(RefDirectory refdb,
boolean forceWrite)
Create writer for ref directory.
|
Modifier and Type | Method and Description |
---|---|
ReflogWriter |
create()
Create the log directories.
|
private byte[] |
encode(ObjectId oldId,
ObjectId newId,
PersonIdent ident,
java.lang.String message) |
private java.io.FileOutputStream |
getFileOutputStream(java.io.File log) |
ReflogWriter |
log(RefUpdate update,
java.lang.String msg,
boolean deref)
Write the given ref update to the ref's log.
|
private ReflogWriter |
log(java.lang.String refName,
byte[] rec) |
ReflogWriter |
log(java.lang.String refName,
ObjectId oldId,
ObjectId newId,
PersonIdent ident,
java.lang.String message)
Write the given entry information to the ref's log
|
ReflogWriter |
log(java.lang.String refName,
ReflogEntry entry)
Write the given entry to the ref's log.
|
static java.lang.String |
refLockFor(java.lang.String name)
Get the ref name to be used for when locking a ref's log for rewriting.
|
private boolean |
shouldAutoCreateLog(java.lang.String refName) |
private final RefDirectory refdb
private final boolean forceWrite
public ReflogWriter(RefDirectory refdb)
refdb
- a RefDirectory
object.public ReflogWriter(RefDirectory refdb, boolean forceWrite)
refdb
- a RefDirectory
object.forceWrite
- true to write to disk all entries logged, false to respect the
repository's config and current log file status.public static java.lang.String refLockFor(java.lang.String name)
name
- name of the ref, relative to the Git repository top level
directory (so typically starts with refs/).public ReflogWriter create() throws java.io.IOException
java.io.IOException
public ReflogWriter log(java.lang.String refName, ReflogEntry entry) throws java.io.IOException
refName
- a String
object.entry
- a ReflogEntry
object.java.io.IOException
public ReflogWriter log(java.lang.String refName, ObjectId oldId, ObjectId newId, PersonIdent ident, java.lang.String message) throws java.io.IOException
refName
- ref nameoldId
- old object idnewId
- new object idident
- a PersonIdent
message
- reflog messagejava.io.IOException
public ReflogWriter log(RefUpdate update, java.lang.String msg, boolean deref) throws java.io.IOException
update
- a RefUpdate
msg
- reflog messagederef
- whether to dereference symbolic refsjava.io.IOException
private byte[] encode(ObjectId oldId, ObjectId newId, PersonIdent ident, java.lang.String message)
private java.io.FileOutputStream getFileOutputStream(java.io.File log) throws java.io.IOException
java.io.IOException
private ReflogWriter log(java.lang.String refName, byte[] rec) throws java.io.IOException
java.io.IOException
private boolean shouldAutoCreateLog(java.lang.String refName)