MCPcopy Create free account
hub / github.com/OpenCppCoverage/OpenCppCoverage / IsGitDetected

Function IsGitDetected

FileFilter/UnifiedDiffParser.cpp:38–58  ·  view source on GitHub ↗

-----------------------------------------------------------------------

Source from the content-addressed store, hash-verified

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(

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected