mirror of
https://github.com/facebook/sapling.git
synced 2024-10-11 01:07:15 +03:00
remotefilelog: fix ctreemanifest serialization
Summary: The serialization was completely broken because std::string.append("\0") treated the argument as a c-string which was completely empty. Let's use the append(char*, size_t) version instead to make sure it appends the correct characters. Also makes othere uses of append in that function match the same pattern. Test Plan: Later patches worked Reviewers: #fastmanifest Subscribers: mjpieters Differential Revision: https://phabricator.intern.facebook.com/D3885014
This commit is contained in:
parent
55d5e7a777
commit
e0483997ca
@ -202,12 +202,12 @@ void Manifest::serialize(std::string &result) {
|
||||
ManifestEntry *entry;
|
||||
while ((entry = iterator.next()) != NULL) {
|
||||
result.append(entry->filename, entry->filenamelen);
|
||||
result.append("\0");
|
||||
result.append("\0", 1);
|
||||
result.append(entry->node, HEX_NODE_SIZE);
|
||||
if (entry->flag) {
|
||||
result.append(1, *entry->flag);
|
||||
result.append(entry->flag, 1);
|
||||
}
|
||||
result.append("\n");
|
||||
result.append("\n", 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user