|
|
@ -270,25 +270,6 @@ public class TreeFormatter { |
|
|
|
overflowBuffer.write((byte) 0); |
|
|
|
overflowBuffer.write((byte) 0); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Compute the current tree's ObjectId. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @return computed ObjectId of the tree |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public ObjectId getTreeId() { |
|
|
|
|
|
|
|
final ObjectInserter.Formatter fmt = new ObjectInserter.Formatter(); |
|
|
|
|
|
|
|
if (buf != null) |
|
|
|
|
|
|
|
return fmt.idFor(OBJ_TREE, buf, 0, ptr); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
final long len = overflowBuffer.length(); |
|
|
|
|
|
|
|
return fmt.idFor(OBJ_TREE, len, overflowBuffer.openInputStream()); |
|
|
|
|
|
|
|
} catch (IOException err) { |
|
|
|
|
|
|
|
// This should never happen, its read failure on a byte array.
|
|
|
|
|
|
|
|
throw new RuntimeException(err); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Insert this tree and obtain its ObjectId. |
|
|
|
* Insert this tree and obtain its ObjectId. |
|
|
|
* |
|
|
|
* |
|
|
|