@@ -11,7 +11,8 @@ bool runcpp2::Data::GitSource::ParseYAML_Node(ryml::ConstNodeRef& node)
1111 {
1212 NodeRequirement (" URL" , ryml::NodeType_e::KEYVAL, true , false ),
1313 NodeRequirement (" Branch" , ryml::NodeType_e::KEYVAL, false , false ),
14- NodeRequirement (" FullHistory" , ryml::NodeType_e::KEYVAL, false , false )
14+ NodeRequirement (" FullHistory" , ryml::NodeType_e::KEYVAL, false , false ),
15+ NodeRequirement (" SubmoduleInitType" , ryml::NodeType_e::KEYVAL, false , false )
1516 };
1617
1718 if (!CheckNodeRequirements (node, requirements))
@@ -27,6 +28,18 @@ bool runcpp2::Data::GitSource::ParseYAML_Node(ryml::ConstNodeRef& node)
2728 if (ExistAndHasChild (node, " FullHistory" ))
2829 node[" FullHistory" ] >> FullHistory;
2930
31+ if (ExistAndHasChild (node, " SubmoduleInitType" ))
32+ {
33+ std::string submoduleTypeString;
34+ node[" SubmoduleInitType" ] >> submoduleTypeString;
35+ CurrentSubmoduleInitType = StringToSubmoduleInitType (submoduleTypeString);
36+ if (CurrentSubmoduleInitType == SubmoduleInitType::COUNT)
37+ {
38+ ssLOG_ERROR (" GitSource: Invalid submodule init type " << submoduleTypeString);
39+ return false ;
40+ }
41+ }
42+
3043 return true ;
3144
3245 INTERNAL_RUNCPP2_SAFE_CATCH_RETURN (false );
@@ -40,10 +53,17 @@ std::string runcpp2::Data::GitSource::ToString(std::string indentation) const
4053 if (!Branch.empty ())
4154 out += indentation + " Branch: " + GetEscapedYAMLString (Branch) + " \n " ;
4255 out += indentation + " FullHistory: " + (FullHistory ? " true" : " false" ) + " \n " ;
56+ out += indentation +
57+ " SubmoduleInitType: " +
58+ SubmoduleInitTypeToString (CurrentSubmoduleInitType) +
59+ " \n " ;
4360 return out;
4461}
4562
4663bool runcpp2::Data::GitSource::Equals (const GitSource& other) const
4764{
48- return URL == other.URL && Branch == other.Branch && FullHistory == other.FullHistory ;
65+ return URL == other.URL &&
66+ Branch == other.Branch &&
67+ FullHistory == other.FullHistory &&
68+ CurrentSubmoduleInitType == other.CurrentSubmoduleInitType ;
4969}
0 commit comments