From b1a7f7fcefe3e96075ecea18c876d4aa2a8e50a4 Mon Sep 17 00:00:00 2001 From: Eric Yen Date: Fri, 4 Mar 2022 09:24:16 -0800 Subject: [PATCH 1/4] check if p4 object is a file --- p4-fusion/commands/describe_result.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/p4-fusion/commands/describe_result.cc b/p4-fusion/commands/describe_result.cc index 74cabaa6..1bc3f34f 100644 --- a/p4-fusion/commands/describe_result.cc +++ b/p4-fusion/commands/describe_result.cc @@ -13,13 +13,17 @@ void DescribeResult::OutputStat(StrDict* varList) int DescribeResult::OutputStatPartial(StrDict* varList) { std::string indexString = std::to_string(m_FileData.size()); - m_FileData.push_back(FileData {}); StrPtr* depotFile = varList->GetVar(("depotFile" + indexString).c_str()); + if(depotFile == nullptr){ + // quick exit if the object returned is not a file + return 0; + } StrPtr* type = varList->GetVar(("type" + indexString).c_str()); StrPtr* revision = varList->GetVar(("rev" + indexString).c_str()); StrPtr* action = varList->GetVar(("action" + indexString).c_str()); - + + m_FileData.push_back(FileData {}); FileData* fileData = &m_FileData.back(); fileData->depotFile = depotFile->Text(); From dac9cb65a6029b9649b763703db27e16bfe28f1c Mon Sep 17 00:00:00 2001 From: twarit-waikar <90855472+twarit-waikar@users.noreply.github.com> Date: Mon, 21 Mar 2022 23:17:34 +0530 Subject: [PATCH 2/4] p4: Minor linting in p4-fusion/commands/describe_result.cc --- p4-fusion/commands/describe_result.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p4-fusion/commands/describe_result.cc b/p4-fusion/commands/describe_result.cc index 1bc3f34f..610fa5c1 100644 --- a/p4-fusion/commands/describe_result.cc +++ b/p4-fusion/commands/describe_result.cc @@ -16,7 +16,7 @@ int DescribeResult::OutputStatPartial(StrDict* varList) StrPtr* depotFile = varList->GetVar(("depotFile" + indexString).c_str()); if(depotFile == nullptr){ - // quick exit if the object returned is not a file + // Quick exit if the object returned is not a file return 0; } StrPtr* type = varList->GetVar(("type" + indexString).c_str()); From fb5a945a715e67f2ac777c557b3be03742d9e3cc Mon Sep 17 00:00:00 2001 From: twarit-waikar <90855472+twarit-waikar@users.noreply.github.com> Date: Mon, 21 Mar 2022 23:17:53 +0530 Subject: [PATCH 3/4] p4: Minor linting in p4-fusion/commands/describe_result.cc --- p4-fusion/commands/describe_result.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/p4-fusion/commands/describe_result.cc b/p4-fusion/commands/describe_result.cc index 610fa5c1..e693012f 100644 --- a/p4-fusion/commands/describe_result.cc +++ b/p4-fusion/commands/describe_result.cc @@ -15,7 +15,8 @@ int DescribeResult::OutputStatPartial(StrDict* varList) std::string indexString = std::to_string(m_FileData.size()); StrPtr* depotFile = varList->GetVar(("depotFile" + indexString).c_str()); - if(depotFile == nullptr){ + if (!depotFile) + { // Quick exit if the object returned is not a file return 0; } From db3b52310d3a24f850026dd4aa3a39a2dee2968e Mon Sep 17 00:00:00 2001 From: twarit-waikar <90855472+twarit-waikar@users.noreply.github.com> Date: Mon, 21 Mar 2022 23:34:24 +0530 Subject: [PATCH 4/4] p4: Minor linting in p4-fusion/commands/describe_result.cc --- p4-fusion/commands/describe_result.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p4-fusion/commands/describe_result.cc b/p4-fusion/commands/describe_result.cc index e693012f..02af1f73 100644 --- a/p4-fusion/commands/describe_result.cc +++ b/p4-fusion/commands/describe_result.cc @@ -23,7 +23,7 @@ int DescribeResult::OutputStatPartial(StrDict* varList) StrPtr* type = varList->GetVar(("type" + indexString).c_str()); StrPtr* revision = varList->GetVar(("rev" + indexString).c_str()); StrPtr* action = varList->GetVar(("action" + indexString).c_str()); - + m_FileData.push_back(FileData {}); FileData* fileData = &m_FileData.back();