@Override public boolean include(TreeWalk walker) { final int n = walker.getTreeCount(); if (n == 1) // Assume they meant difference to empty tree. return true; final int m = walker.getRawMode(baseTree); for (int i = 1; i < n; i++) if (walker.getRawMode(i) != m || !walker.idEqual(i, baseTree)) return true; return false; }
/** * Obtain the {@link org.eclipse.jgit.lib.FileMode} for the current entry. * <p> * Every added tree supplies a mode, even if the tree does not contain the * current entry. In the latter case * {@link org.eclipse.jgit.lib.FileMode#MISSING} is returned. * * @param nth * tree to obtain the mode from. * @return mode for the current entry of the nth tree. */ public FileMode getFileMode(int nth) { return FileMode.fromBits(getRawMode(nth)); }
static PushCertificate read(TreeWalk tw) throws IOException { if (tw == null || (tw.getRawMode(0) & TYPE_FILE) != TYPE_FILE) { return null; } ObjectLoader loader = tw.getObjectReader().open(tw.getObjectId(0), OBJ_BLOB); try (InputStream in = loader.openStream(); Reader r = new BufferedReader( new InputStreamReader(in, UTF_8))) { return PushCertificateParser.fromReader(r); } }
private boolean find(RevCommit commit, PathFilter path) throws IOException { treeWalk.setFilter(path); treeWalk.reset(commit.getTree()); if (treeWalk.next() && isFile(treeWalk.getRawMode(0))) { treeWalk.getObjectId(idBuf, 0); return true; } return false; }
/** {@inheritDoc} */ @Override public boolean include(TreeWalk walker) { final int n = walker.getTreeCount(); if (n == 1) // Assume they meant difference to empty tree. return true; final int m = walker.getRawMode(baseTree); for (int i = 1; i < n; i++) { DirCacheIterator baseDirCache = walker.getTree(baseTree, DirCacheIterator.class); DirCacheIterator newDirCache = walker.getTree(i, DirCacheIterator.class); if (baseDirCache != null && newDirCache != null) { DirCacheEntry baseDci = baseDirCache.getDirCacheEntry(); DirCacheEntry newDci = newDirCache.getDirCacheEntry(); if (baseDci != null && newDci != null) { if (baseDci.isAssumeValid() != newDci.isAssumeValid()) return true; if (baseDci.isAssumeValid()) // && newDci.isAssumeValid() return false; } } if (walker.getRawMode(i) != m || !walker.idEqual(i, baseTree)) return true; } return false; }
while (tw.next()) { chgs++; if (tw.getRawMode(0) == 0 && tw.getRawMode(1) != 0) adds++; else final int[] adds = new int[nParents]; while (tw.next()) { final int myMode = tw.getRawMode(nParents); for (int i = 0; i < nParents; i++) { final int pMode = tw.getRawMode(i); if (myMode == pMode && tw.idEqual(i, nParents)) continue;
IncorrectObjectTypeException, IOException { final int cnt = tw.getTreeCount(); final int wm = tw.getRawMode(workingTree); WorkingTreeIterator wi = workingTree(tw); String path = tw.getPathString(); int rmode = tw.getRawMode(i); if (i != workingTree && rmode != FileMode.TYPE_MISSING && FileMode.TREE.equals(rmode)) { final int dm = tw.getRawMode(dirCache); if (dm == FileMode.TYPE_MISSING) { if (honorIgnores && wi.isEntryIgnored()) { if (i == dirCache || i == workingTree) continue; if (tw.getRawMode(i) != FileMode.TYPE_MISSING) break; if (i == dirCache || i == workingTree) continue; if (tw.getRawMode(i) != dm || !tw.idEqual(i, dirCache)) return true;
checkCancelled(); ObjectId objectId = treeWalk.getObjectId(0); switch (treeWalk.getRawMode(0) & FileMode.TYPE_MASK) { case FileMode.TYPE_MISSING: case FileMode.TYPE_GITLINK: JGitText.get().corruptObjectInvalidMode3, String.format("%o", //$NON-NLS-1$ Integer.valueOf(treeWalk.getRawMode(0))), (objectId == null) ? "null" : objectId.name(), //$NON-NLS-1$
@Override public boolean include(final TreeWalk walker) throws IOException { if (type == (walker.getRawMode(0) & TYPE_MASK)) count++; return true; }
tw.addTree(rw.parseCommit(committed).getTree()); while (tw.next()) { if (tw.getRawMode(0) != TYPE_GITLINK || tw.isPathSuffix(PEEL, 2)) {
private static boolean matchAnyParent(final TreeWalk walk, final int myTree) { final int m = walk.getRawMode(myTree); for (int i = 0; i < myTree; i++) if (walk.getRawMode(i) == m && walk.idEqual(i, myTree)) return true; return false; }
@Override public boolean include(TreeWalk walker) throws MissingObjectException, IncorrectObjectTypeException, IOException { int m0 = walker.getRawMode(0); // only include the path if the file is modified in head commit // compared to base commit and that modification is not introduced // by commit from target branch return (walker.getRawMode(1) != m0 || !walker.idEqual(1, 0)) && (walker.getRawMode(2) != m0 || !walker.idEqual(2, 0)); }
if (tw.getRawMode(1) == TYPE_GITLINK && !tw.isPathSuffix(PEEL, 2)) { newObjs.add(tw.getObjectId(1));
@Override public boolean include(TreeWalk walker) { final int n = walker.getTreeCount(); if (n == 1) // Assume they meant difference to empty tree. return true; final int m = walker.getRawMode(baseTree); for (int i = 1; i < n; i++) if (walker.getRawMode(i) != m || !walker.idEqual(i, baseTree)) return true; return false; }
@Override public boolean include(final TreeWalk walker) { final int n = walker.getTreeCount(); if (n == 1) // Assume they meant difference to empty tree. return true; final int m = walker.getRawMode(baseTree); for (int i = 1; i < n; i++) if (walker.getRawMode(i) != m || !walker.idEqual(i, baseTree)) return true; return false; }
/** * Obtain the {@link FileMode} for the current entry. * <p> * Every added tree supplies a mode, even if the tree does not contain the * current entry. In the latter case {@link FileMode#MISSING} is returned. * * @param nth * tree to obtain the mode from. * @return mode for the current entry of the nth tree. */ public FileMode getFileMode(final int nth) { return FileMode.fromBits(getRawMode(nth)); }
static PushCertificate read(TreeWalk tw) throws IOException { if (tw == null || (tw.getRawMode(0) & TYPE_FILE) != TYPE_FILE) { return null; } ObjectLoader loader = tw.getObjectReader().open(tw.getObjectId(0), OBJ_BLOB); try (InputStream in = loader.openStream(); Reader r = new BufferedReader(new InputStreamReader(in, UTF_8))) { return PushCertificateParser.fromReader(r); } }
static PushCertificate read(TreeWalk tw) throws IOException { if (tw == null || (tw.getRawMode(0) & TYPE_FILE) != TYPE_FILE) { return null; } ObjectLoader loader = tw.getObjectReader().open(tw.getObjectId(0), OBJ_BLOB); try (InputStream in = loader.openStream(); Reader r = new BufferedReader( new InputStreamReader(in, UTF_8))) { return PushCertificateParser.fromReader(r); } }
private boolean find(RevCommit commit, PathFilter path) throws IOException { treeWalk.setFilter(path); treeWalk.reset(commit.getTree()); if (treeWalk.next() && isFile(treeWalk.getRawMode(0))) { treeWalk.getObjectId(idBuf, 0); return true; } return false; }
private boolean find(RevCommit commit, PathFilter path) throws IOException { treeWalk.setFilter(path); treeWalk.reset(commit.getTree()); if (treeWalk.next() && isFile(treeWalk.getRawMode(0))) { treeWalk.getObjectId(idBuf, 0); return true; } return false; }