Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.ObjectId


        continue;
      for (String e : entries) {
        if (e.length() != Constants.OBJECT_ID_STRING_LENGTH - 2)
          continue;
        try {
          ObjectId id = ObjectId.fromString(d + e);
          unpackedObjects.add(new UnpackedObjectId(id));
        } catch (IllegalArgumentException notAnObject) {
          // ignoring the file that does not represent loose object
        }
      }
View Full Code Here


  }

  private void markReachable(final Set<ObjectId> have, final int maxTime)
      throws IOException {
    for (final Ref r : local.getAllRefs().values()) {
      ObjectId id = r.getPeeledObjectId();
      if (id == null)
        id = r.getObjectId();
      if (id == null)
        continue;
      parseReachable(id);
View Full Code Here

    builder.setAuthor(new PersonIdent(repo));
    builder.setCommitter(builder.getAuthor());
    builder.setMessage(msg);
    if (notesCommit != null)
      builder.setParentIds(notesCommit);
    ObjectId commit = inserter.insert(builder);
    inserter.flush();
    RefUpdate refUpdate = repo.updateRef(notesRef);
    if (notesCommit != null)
      refUpdate.setExpectedOldObjectId(notesCommit);
    else
View Full Code Here

        final int tab = line.indexOf('\t');
        if (tab < 0)
          throw invalidAdvertisement(line);

        String name;
        final ObjectId id;

        name = line.substring(tab + 1);
        id = ObjectId.fromString(line.substring(0, tab));
        if (name.endsWith("^{}")) { //$NON-NLS-1$
          name = name.substring(0, name.length() - 3);
View Full Code Here

      Ref ref = commits.get(0);

      refLogMessage.append(ref.getName());

      // handle annotated tags
      ObjectId objectId = ref.getPeeledObjectId();
      if (objectId == null)
        objectId = ref.getObjectId();

      RevCommit srcCommit = revWalk.lookupCommit(objectId);

      ObjectId headId = head.getObjectId();
      if (headId == null) {
        revWalk.parseHeaders(srcCommit);
        DirCacheCheckout dco = new DirCacheCheckout(repo,
            repo.lockDirCache(), srcCommit.getTree());
        dco.setFailOnConflict(true);
View Full Code Here

      // loop through all refs to be cherry-picked
      for (Ref src : commits) {
        // get the commit to be cherry-picked
        // handle annotated tags
        ObjectId srcObjectId = src.getPeeledObjectId();
        if (srcObjectId == null)
          srcObjectId = src.getObjectId();
        RevCommit srcCommit = revWalk.parseCommit(srcObjectId);

        // get the parent of the commit to cherry-pick
View Full Code Here

      }

      Ref headRef = repo.getRef(Constants.HEAD);
      String refLogMessage = "checkout: moving from "
          + headRef.getTarget().getName();
      ObjectId branch = repo.resolve(name);
      if (branch == null)
        throw new RefNotFoundException(MessageFormat.format(JGitText
            .get().refNotResolved, name));

      RevWalk revWalk = new RevWalk(repo);
View Full Code Here

        startWalk.setRecursive(true);
        startWalk.setFilter(treeWalk.getFilter());
        startWalk.addTree(revWalk.parseCommit(getStartPoint())
            .getTree());
        while (startWalk.next()) {
          final ObjectId blobId = startWalk.getObjectId(0);
          editor.add(new PathEdit(startWalk.getPathString()) {

            public void apply(DirCacheEntry ent) {
              ent.setObjectId(blobId);
            }
View Full Code Here

  private ObjectId getStartPoint() throws AmbiguousObjectException,
      RefNotFoundException, IOException {
    if (startCommit != null)
      return startCommit.getId();
    ObjectId result = null;
    try {
      result = repo.resolve((startPoint == null) ? Constants.HEAD
          : startPoint);
    } catch (AmbiguousObjectException e) {
      throw e;
View Full Code Here

      final boolean cherryPicking = state
          .equals(RepositoryState.CHERRY_PICKING)
          || state.equals(RepositoryState.CHERRY_PICKING_RESOLVED);

      // resolve the ref to a commit
      final ObjectId commitId;
      try {
        commitId = repo.resolve(ref);
      } catch (IOException e) {
        throw new JGitInternalException(
            MessageFormat.format(JGitText.get().cannotRead, ref),
            e);
      }
      RevWalk rw = new RevWalk(repo);
      try {
        commit = rw.parseCommit(commitId);
      } catch (IOException e) {
        throw new JGitInternalException(
            MessageFormat.format(
            JGitText.get().cannotReadCommit, commitId.toString()),
            e);
      } finally {
        rw.release();
      }
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.lib.ObjectId

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.