mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-26 15:56:18 +02:00
git/dumpTree: Assert name not empty before back()
This commit is contained in:
parent
850c9a6caf
commit
3b7f2bf997
1 changed files with 1 additions and 0 deletions
|
@ -251,6 +251,7 @@ void dumpTree(const Tree & entries, Sink & sink,
|
||||||
for (auto & [name, entry] : entries) {
|
for (auto & [name, entry] : entries) {
|
||||||
auto name2 = name;
|
auto name2 = name;
|
||||||
if (entry.mode == Mode::Directory) {
|
if (entry.mode == Mode::Directory) {
|
||||||
|
assert(!name2.empty());
|
||||||
assert(name2.back() == '/');
|
assert(name2.back() == '/');
|
||||||
name2.pop_back();
|
name2.pop_back();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue