Skip to content

Commit

Permalink
git/dumpTree: Assert name not empty before back()
Browse files Browse the repository at this point in the history
  • Loading branch information
roberth committed Mar 23, 2024
1 parent 850c9a6 commit 3b7f2bf
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/libutil/git.cc
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ void dumpTree(const Tree & entries, Sink & sink,
for (auto & [name, entry] : entries) {
auto name2 = name;
if (entry.mode == Mode::Directory) {
assert(!name2.empty());
assert(name2.back() == '/');
name2.pop_back();
}
Expand Down

0 comments on commit 3b7f2bf

Please sign in to comment.