From 0dfbf68c0177dfdc4948309c468f7b457d8122a4 Mon Sep 17 00:00:00 2001 From: Sichao25 Date: Thu, 3 Jul 2025 20:04:46 -0400 Subject: [PATCH] debug branch removal --- cdash/nightly.cmake | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/cdash/nightly.cmake b/cdash/nightly.cmake index f2b2e0910..a69a7e3d7 100644 --- a/cdash/nightly.cmake +++ b/cdash/nightly.cmake @@ -94,11 +94,11 @@ endfunction(git_exec) function(remove_branch_if_exists BRANCH_NAME) message("Attempting to delete ${BRANCH_NAME} if it exists") - execute_process(COMMAND "${CTEST_GIT_COMMAND}" branch --list ${BRANCH_NAME} - WORKING_DIRECTORY"${CTEST_SOURCE_DIRECTORY}/${CTEST_PROJECT_NAME}" + execute_process(COMMAND "${CTEST_GIT_COMMAND}" show-ref --quiet refs/heads/${BRANCH_NAME} + WORKING_DIRECTORY "${CTEST_SOURCE_DIRECTORY}/${CTEST_PROJECT_NAME}" RESULT_VARIABLE BRANCH_RET) - message("git branch --list returned: ${BRANCH_RET})!") - if(BRANCH_RET) + message("git branch --list returned: ${BRANCH_RET}!") + if(NOT BRANCH_RET) message("${BRANCH_NAME} exists. Attempting to delete it.") git_exec("branch -D ${BRANCH_NAME}" "Deleted ${BRANCH_NAME}.") endif()