Library functions for tree and blob manipulation