Skip to content

Commit

Permalink
Handle cases where all files in a VCS dir were skipped (e.g. due to n…
Browse files Browse the repository at this point in the history
…ot being found)
  • Loading branch information
rocallahan committed Apr 17, 2021
1 parent 340e04e commit 165f85a
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions src/SourcesCommand.cc
Original file line number Diff line number Diff line change
Expand Up @@ -723,10 +723,20 @@ static int sources(const map<string, string>& binary_file_names, const map<strin
while (!vcs_stack.empty() && !starts_with(f, *vcs_stack.back())) {
vcs_stack.pop_back();
}
while (vcs_dir_iterator != vcs_dirs.end() && starts_with(f, *vcs_dir_iterator)) {
vcs_stack.push_back(&*vcs_dir_iterator);
vcs_dirs_vector.push_back(&*vcs_dir_iterator);
++vcs_dir_iterator;
while (vcs_dir_iterator != vcs_dirs.end()) {
if (starts_with(f, *vcs_dir_iterator)) {
vcs_stack.push_back(&*vcs_dir_iterator);
vcs_dirs_vector.push_back(&*vcs_dir_iterator);
++vcs_dir_iterator;
continue;
}
if (*vcs_dir_iterator < f) {
// Skip this VCS dir because all of its files must have been
// skipped (not found).
++vcs_dir_iterator;
continue;
}
break;
}
if (vcs_stack.empty()) {
if (!pushed_empty_string) {
Expand Down

0 comments on commit 165f85a

Please sign in to comment.