java.lang.Object
org.eclipse.jgit.internal.storage.file.GcLog

class GcLog extends Object
This class manages the gc.log file for a FileRepository.
  • Field Details

  • Constructor Details

  • Method Details

    • getLogExpiry

      private Instant getLogExpiry() throws ParseException
      Throws:
      ParseException
    • autoGcBlockedByOldLockFile

      private boolean autoGcBlockedByOldLockFile()
    • lock

      boolean lock()
      Lock the GC log file for updates
      Returns:
      true if we hold the lock
    • unlock

      void unlock()
      Unlock (roll back) the GC log lock
    • commit

      boolean commit()
      Commit changes to the gc log, if there have been any writes. Otherwise, just unlock and delete the existing file (if any)
      Returns:
      true if committing (or unlocking/deleting) succeeds.
    • write

      void write(String content) throws IOException
      Write to the pending gc log. Content will be committed upon a call to commit()
      Parameters:
      content - The content to write
      Throws:
      IOException