-----------------------------------------------------------------------
| 36 | |
| 37 | //----------------------------------------------------------------------- |
| 38 | bool IsGitDetected( |
| 39 | const std::vector<File>& files, |
| 40 | const std::vector<std::wstring>& sourceFileLines, |
| 41 | bool foundGitHeader) |
| 42 | { |
| 43 | if (!foundGitHeader) |
| 44 | return false; |
| 45 | |
| 46 | auto isGitTarget = std::all_of(files.begin(), files.end(), [](const auto& file) |
| 47 | { |
| 48 | return boost::algorithm::starts_with(file.GetPath().wstring(), GitTargetPrefix); |
| 49 | }); |
| 50 | |
| 51 | auto isGitSource = std::all_of(sourceFileLines.begin(), sourceFileLines.end(), |
| 52 | [](const auto& line) |
| 53 | { |
| 54 | return boost::algorithm::starts_with(line, UnifiedDiffParser::FromFilePrefix + L"a/"); |
| 55 | }); |
| 56 | |
| 57 | return isGitTarget && isGitSource; |
| 58 | } |
| 59 | |
| 60 | //----------------------------------------------------------------------- |
| 61 | void UpdateFilePathIfGitDetected( |
no outgoing calls
no test coverage detected