mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
add optional size and contentSha1 fields to TreeEntry
Summary: We'll start populating these in the mononoke client. They are currently unused. Reviewed By: chadaustin Differential Revision: D12814791 fbshipit-source-id: f5407de5cdb9f1f3ad6ee2befed50e2a7562ec97
This commit is contained in:
parent
b43707234c
commit
7d10cfea88
@ -52,6 +52,18 @@ class TreeEntry {
|
||||
TreeEntryType type)
|
||||
: type_(type), hash_(hash), name_(PathComponentPiece(name)) {}
|
||||
|
||||
explicit TreeEntry(
|
||||
const Hash& hash,
|
||||
folly::StringPiece name,
|
||||
TreeEntryType type,
|
||||
std::optional<uint64_t> size,
|
||||
std::optional<Hash> contentSha1)
|
||||
: type_(type),
|
||||
hash_(hash),
|
||||
name_(PathComponentPiece(name)),
|
||||
size_(size),
|
||||
contentSha1_(contentSha1) {}
|
||||
|
||||
const Hash& getHash() const {
|
||||
return hash_;
|
||||
}
|
||||
@ -70,10 +82,20 @@ class TreeEntry {
|
||||
|
||||
std::string toLogString() const;
|
||||
|
||||
const std::optional<uint64_t>& getSize() const {
|
||||
return size_;
|
||||
}
|
||||
|
||||
const std::optional<Hash>& getContentSha1() const {
|
||||
return contentSha1_;
|
||||
}
|
||||
|
||||
private:
|
||||
TreeEntryType type_;
|
||||
Hash hash_;
|
||||
PathComponent name_;
|
||||
std::optional<uint64_t> size_;
|
||||
std::optional<Hash> contentSha1_;
|
||||
};
|
||||
|
||||
std::ostream& operator<<(std::ostream& os, TreeEntryType type);
|
||||
|
Loading…
Reference in New Issue
Block a user