Package org.eclipse.jgit.storage.file

Examples of org.eclipse.jgit.storage.file.ReflogWriter


    if (entries.size() == 1) {
      deleteRef(stashRef);
      return null;
    }

    ReflogWriter writer = new ReflogWriter(repo, true);
    String stashLockRef = ReflogWriter.refLockFor(R_STASH);
    File stashLockFile = writer.logFor(stashLockRef);
    File stashFile = writer.logFor(R_STASH);
    if (stashLockFile.exists())
      throw new JGitInternalException(JGitText.get().stashDropFailed,
          new LockFailedException(stashFile));

    entries.remove(stashRefEntry);
    ObjectId entryId = ObjectId.zeroId();
    try {
      for (int i = entries.size() - 1; i >= 0; i--) {
        ReflogEntry entry = entries.get(i);
        writer.log(stashLockRef, entryId, entry.getNewId(),
            entry.getWho(), entry.getComment());
        entryId = entry.getNewId();
      }
      if (!stashLockFile.renameTo(stashFile)) {
        FileUtils.delete(stashFile);
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.storage.file.ReflogWriter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.