Package org.eclipse.jgit.lib

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


    assertEquals(aSlashCSlashD.getObjectId(),
        TreeWalk.forPath(or, "a/c/d", tree).getObjectId(0));
    assertEquals(aSlashCSlashD.getObjectId(), TreeWalk
        .forPath(or, "c/d", a).getObjectId(0));

    or.release();
    oi.release();
  }

}
View Full Code Here


    } catch (JGitInternalException e) {
      throw e;
    } catch (IOException e) {
      throw new JGitInternalException(JGitText.get().stashApplyFailed, e);
    } finally {
      reader.release();
    }
  }

  /**
   * @param applyIndex
View Full Code Here

      // commit the index builder - a new index is persisted
      if (!builder.commit())
        throw new IndexWriteException();
    } finally {
      objectReader.release();
    }
    return toBeDeleted.size() == 0;
  }

  private static boolean isSamePrefix(String a, String b) {
View Full Code Here

      DirCacheEntry entry) throws IOException {
    ObjectReader or = repository.newObjectReader();
    try {
      checkoutEntry(repository, f, entry, repository.newObjectReader());
    } finally {
      or.release();
    }
  }

  /**
   * Updates the file in the working tree with content and mode from an entry
View Full Code Here

          final Ref ref = e.getValue();
          printHead(reader, e.getKey(),
              current.equals(ref.getName()), ref);
        }
      } finally {
        reader.release();
      }
    }
  }

  private void addRefs(final Collection<Ref> refs, final String prefix) {
View Full Code Here

      byte[] result;
      try {
        ObjectId oid = repo.resolve(ref + ":" + path); //$NON-NLS-1$
        result = reader.open(oid).getBytes(Integer.MAX_VALUE);
      } finally {
        reader.release();
      }
      return result;
    }
  }
View Full Code Here

          CanonicalTreeParser p = new CanonicalTreeParser();
          ObjectReader reader = db.newObjectReader();
          try {
            p.reset(reader, head);
          } finally {
            reader.release();
          }
          oldTree = p;
        }
        newTree = new DirCacheIterator(db.readDirCache());
      } else if (oldTree == null) {
View Full Code Here

          CanonicalTreeParser p = new CanonicalTreeParser();
          ObjectReader reader = repo.newObjectReader();
          try {
            p.reset(reader, head);
          } finally {
            reader.release();
          }
          oldTree = p;
        }
        newTree = new DirCacheIterator(repo.readDirCache());
      } else {
View Full Code Here

      IncorrectObjectTypeException, CorruptObjectException, IOException {
    ObjectReader reader = db.newObjectReader();
    try {
      return forPath(reader, path, trees);
    } finally {
      reader.release();
    }
  }

  /**
   * Open a tree walk and filter to exactly one path.
View Full Code Here

        }
        if (count > 0 && files > count)
          break;
      }
    } finally {
      or.release();
    }

    Collections.sort(all, new Comparator<Test>() {
      public int compare(Test a, Test b) {
        int cmp = Long.signum(a.runningTimeNanos - b.runningTimeNanos);
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.