eden/fs/service/EdenServiceHandler.cpp
// TODO(mbolin): Make this a method of ObjectStore and make it Future-based.
Make this a method of ObjectStore and make it Future-based.
Make this a method of ObjectStore and make it Future - based .
std::optional<mode_t> EdenServiceHandler::isInManifestAsFile(
    const EdenMount* mount,
    const RelativePathPiece filename) {
#ifndef _WIN32
  auto tree = mount->getRootTree();
  auto parentDirectory = filename.dirname();
  auto objectStore = mount->getObjectStore();
  for (auto piece : parentDirectory.components()) {
    auto entry = tree->getEntryPtr(piece);
    if (entry != nullptr && entry->isTree()) {
      tree = objectStore->getTree(entry->getHash()).get();
    } else {
      return std::nullopt;
    }
  }
  if (tree != nullptr) {
    auto entry = tree->getEntryPtr(filename.basename());
    if (entry != nullptr && !entry->isTree()) {
      return modeFromTreeEntryType(entry->getType());
    }
  }
  return std::nullopt;
#else
  NOT_IMPLEMENTED();
#endif 
}
std :: optional < mode_t > EdenServiceHandler :: isInManifestAsFile ( const EdenMount * mount , const RelativePathPiece filename ) { #ifndef _WIN32 auto tree = mount -> getRootTree ( ) ; auto parentDirectory = filename . dirname ( ) ; auto objectStore = mount -> getObjectStore ( ) ; for ( auto piece : parentDirectory . components ( ) ) { auto entry = tree -> getEntryPtr ( piece ) ; if ( entry != nullptr && entry -> isTree ( ) ) { tree = objectStore -> getTree ( entry -> getHash ( ) ) . get ( ) ; } else { return std :: nullopt ; } } if ( tree != nullptr ) { auto entry = tree -> getEntryPtr ( filename . basename ( ) ) ; if ( entry != nullptr && ! entry -> isTree ( ) ) { return modeFromTreeEntryType ( entry -> getType ( ) ) ; } } return std :: nullopt ; #else NOT_IMPLEMENTED ( ) ; #endif }
TODO(mbolin): Make this a method of ObjectStore and make it Future-based.
TODO ( mbolin ) : Make this a method of ObjectStore and make it Future - based .
// !_WIN32