Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.ObjectReader.release()


          }
        }
      }

      // finished
      reader.release();

      // commit all changes and reset the searcher
      config.setInt(CONF_INDEX, null, CONF_VERSION, INDEX_VERSION);
      config.save();
      writer.commit();
View Full Code Here


          assertEquals(entry.getLength(), r.getObjectSize(
              entry.getObjectId(), ObjectReader.OBJ_ANY));
      }
    } finally {
      dc.unlock();
      r.release();
    }
  }

  public void testCheckoutMixedNewlines() throws Exception {
    // "git config core.autocrlf true"
View Full Code Here

        outw.format(" %c %-17s %-10s -> %s", valueOf(type), longType, //$NON-NLS-1$
            src, dst);
        outw.println();
      }
    } finally {
      reader.release();
    }
    showRemoteMessages(errw, r.getMessages());
  }

  static void showRemoteMessages(ThrowingPrintWriter writer, String pkt) throws IOException {
View Full Code Here

    } catch (IncorrectObjectTypeException e) {
      throw new CmdLineException(MessageFormat.format(CLIText.get().notATree, name));
    } catch (IOException e) {
      throw new CmdLineException(MessageFormat.format(CLIText.get().cannotReadBecause, name, e.getMessage()));
    } finally {
      curs.release();
    }

    setter.addValue(p);
    return 1;
  }
View Full Code Here

    for (PushResult result : results) {
      ObjectReader reader = db.newObjectReader();
      try {
        printPushResult(reader, result.getURI(), result);
      } finally {
        reader.release();
      }
    }
  }

  private void printPushResult(final ObjectReader reader, final URIish uri,
View Full Code Here

    final ObjectReader or = db.newObjectReader();
    try {
      p.reset(or, new RevWalk(db).parseTree(id));
      return p;
    } finally {
      or.release();
    }
  }
}
View Full Code Here

      // Return stashed commit
      return parseCommit(reader, commitId);
    } catch (IOException e) {
      throw new JGitInternalException(JGitText.get().stashFailed, e);
    } finally {
      reader.release();
    }
  }
}
View Full Code Here

    ObjectId fromRaw = ObjectId.fromRaw(fti.idBuffer(), fti.idOffset());
    assertEquals("6b584e8ece562ebffc15d38808cd6b98fc3d97ea",
        fromRaw.getName());
    ObjectReader objectReader = db.newObjectReader();
    assertFalse(fti.isModified(dce, false, objectReader));
    objectReader.release();
  }

  @Test
  public void testIsModifiedSymlinkAsFile() throws Exception {
    File f = writeTrashFile("symlink", "content");
View Full Code Here

        .getConfig().get(WorkingTreeOptions.KEY));
    while (!fti.getEntryPathString().equals("symlink"))
      fti.next(1);
    ObjectReader objectReader = db.newObjectReader();
    assertFalse(fti.isModified(dce, false, objectReader));
    objectReader.release();
  }

  @Test
  public void testIsModifiedFileSmudged() throws Exception {
    File f = writeTrashFile("file", "content");
View Full Code Here

    // If the rounding trick does not work we could skip the compareMetaData
    // test and hope that we are usually testing the intended code path.
    assertEquals(MetadataDiff.SMUDGED, fti.compareMetadata(dce));
    ObjectReader objectReader = db.newObjectReader();
    assertTrue(fti.isModified(dce, false, objectReader));
    objectReader.release();
  }

  @Test
  public void submoduleHeadMatchesIndex() throws Exception {
    Git git = new Git(db);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.