Class ReflogWriter


  • public class ReflogWriter
    extends Object
    Utility for writing reflog entries
    Since:
    2.0
    • Constructor Detail

      • ReflogWriter

        public ReflogWriter​(Repository repository)
        Create write for repository
        Parameters:
        repository -
      • ReflogWriter

        public ReflogWriter​(Repository repository,
                            boolean forceWrite)
        Create write for repository
        Parameters:
        repository -
        forceWrite - true to write to disk all entries logged, false to respect the repository's config and current log file status
    • Method Detail

      • refLockFor

        public static String refLockFor​(String name)
        Get the ref name to be used for when locking a ref's log for rewriting
        Parameters:
        name - name of the ref, relative to the Git repository top level directory (so typically starts with refs/).
        Returns:
        the name of the ref's lock ref
      • getRepository

        public Repository getRepository()
        Get repository that reflog is being written for
        Returns:
        file repository
      • logFor

        public File logFor​(String name)
        Locate the log file on disk for a single reference name.
        Parameters:
        name - name of the ref, relative to the Git repository top level directory (so typically starts with refs/).
        Returns:
        the log file location.