From 7f98d19a8c6a6697e246338d2c3a0640cd9528c8 Mon Sep 17 00:00:00 2001 From: Paul Cristian Sarbu Date: Mon, 23 Jan 2023 14:53:03 +0100 Subject: Just-MR: Remove obsolete GET_BRANCH_REFNAME critical Git operation As now all remote Git operations in GitRepo require at most just the branch name, there is no more need to inquire the repository about branch refspecs. --- .../other_tools/git_operations/critical_git_ops.test.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) (limited to 'test/other_tools/git_operations/critical_git_ops.test.cpp') diff --git a/test/other_tools/git_operations/critical_git_ops.test.cpp b/test/other_tools/git_operations/critical_git_ops.test.cpp index 7c74d352..c7fedda0 100644 --- a/test/other_tools/git_operations/critical_git_ops.test.cpp +++ b/test/other_tools/git_operations/critical_git_ops.test.cpp @@ -128,10 +128,6 @@ TEST_CASE("Crtitical git operations", "[critical_git_op_map]") { // 5. Get head commit -> needs a repo with a commit auto path_get_head_id = TestUtilsMP::CreateTestRepoWithCheckout(*prefix); REQUIRE(path_get_head_id); - // 6. Get local branch refname -> needs a repo with a commit - auto path_get_branch_refname = - TestUtilsMP::CreateTestRepoWithCheckout(*prefix); - REQUIRE(path_get_branch_refname); // create the map auto crit_op_guard = std::make_shared(); @@ -141,9 +137,9 @@ TEST_CASE("Crtitical git operations", "[critical_git_op_map]") { // should retrieve the value from the map, not call the operation again. // helper lists const std::vector ops_all{ - 0, 1, 2, 3, 4, 5}; // indices of all ops tested + 0, 1, 2, 3, 4}; // indices of all ops tested const std::vector ops_with_result{ - 0, 4, 5}; // indices of ops that return a non-empty string + 0, 4}; // indices of ops that return a non-empty string // Add to the map all ops multiple times for ([[maybe_unused]] auto const& i : {0, 0, 0}) { // replace once ranges are available @@ -189,13 +185,7 @@ TEST_CASE("Crtitical git operations", "[critical_git_op_map]") { "", // git_hash "", // branch }, - GitOpType::GET_HEAD_ID}, - GitOpKey{GitOpParams{ - *path_get_branch_refname, // target_path - "", // git_hash - "master", // branch - }, - GitOpType::GET_BRANCH_REFNAME}}, + GitOpType::GET_HEAD_ID}}, [&ops_all, &ops_with_result](auto const& values) { // check operations for (size_t const& i : ops_all) { -- cgit v1.2.3