/** * Is the current entry a subtree? * <p> * This method is faster then testing the raw mode bits of all trees to see * if any of them are a subtree. If at least one is a subtree then this * method will return true. * * @return true if {@link #enterSubtree()} will work on the current node. */ public boolean isSubtree() { return FileMode.TREE.equals(currentHead.mode); }
private static boolean nonTree(int mode) { return mode != 0 && !FileMode.TREE.equals(mode); }
private boolean isGitlink(AbstractTreeIterator p) { return FileMode.GITLINK.equals(p.mode); }
private static boolean isTree(AbstractTreeIterator p) { return FileMode.TREE.equals(p.mode); }
private static boolean isGitLink(int mode) { return FileMode.GITLINK.equals(mode); }
private static boolean nonTree(int mode) { return mode != 0 && !FileMode.TREE.equals(mode); }
private boolean isTree() { return TREE.equals(mode); }
return p[ci] == '/' && FileMode.TREE.equals(t.mode) ? -1 : 1;
return p[ci] == '/' && FileMode.TREE.equals(t.mode) ? 0 : -1;
/** {@inheritDoc} */ @Override public CanonicalTreeParser createSubtreeIterator(final ObjectReader reader, final MutableObjectId idBuffer) throws IncorrectObjectTypeException, IOException { idBuffer.fromRaw(idBuffer(), idOffset()); if (!FileMode.TREE.equals(mode)) { final ObjectId me = idBuffer.toObjectId(); throw new IncorrectObjectTypeException(me, TYPE_TREE); } return createSubtreeIterator0(reader, idBuffer); }
/** * Is the file mode of the current entry different than the given raw mode? * * @param rawMode * an int. * @return true if different, false otherwise */ public boolean isModeDifferent(int rawMode) { // Determine difference in mode-bits of file and index-entry. In the // bitwise presentation of modeDiff we'll have a '1' when the two modes // differ at this position. int modeDiff = getEntryRawMode() ^ rawMode; if (modeDiff == 0) return false; // Do not rely on filemode differences in case of symbolic links if (getOptions().getSymLinks() == SymLinks.FALSE) if (FileMode.SYMLINK.equals(rawMode)) return false; // Ignore the executable file bits if WorkingTreeOptions tell me to // do so. Ignoring is done by setting the bits representing a // EXECUTABLE_FILE to '0' in modeDiff if (!state.options.isFileMode()) modeDiff &= ~FileMode.EXECUTABLE_FILE.getBits(); return modeDiff != 0; }
? rules.checkIgnored(pathRel, FileMode.TREE.equals(fileMode)) : null; if (ignored != null) {
CheckoutMetadata meta = e.getValue(); DirCacheEntry entry = dc.getEntry(path); if (FileMode.GITLINK.equals(entry.getRawMode())) { checkoutGitlink(path, entry); } else {
if (FileMode.EXECUTABLE_FILE.equals(entry.getRawMode())) { if (!fs.canExecute(tmpFile)) fs.setExecute(tmpFile, true);
private void add(int tree, int stage) throws IOException { final AbstractTreeIterator i = getTree(tree); if (i != null) { if (FileMode.TREE.equals(tw.getRawMode(tree))) { builder.addTree(tw.getRawPath(), stage, reader, tw .getObjectId(tree)); } else { final DirCacheEntry e; e = new DirCacheEntry(tw.getRawPath(), stage); e.setObjectIdFromRaw(i.idBuffer(), i.idOffset()); e.setFileMode(tw.getFileMode(tree)); builder.add(e); } } }
public TreeFormatterEntry(String name, FileMode mode, ObjectId id) { this.name = name; this.mode = mode; this.id = id; if (mode.equals(FileMode.TYPE_TREE)) nameBytes = (name + "/").getBytes(Charsets.UTF_8); else nameBytes = name.getBytes(Charsets.UTF_8); }
if (recursive && FileMode.TREE.equals(t.mode)) { enterSubtree(); continue;
if (!FileMode.TREE.equals(parser.getEntryRawMode())) continue CHECK_BASE;