From baa8597076600e93755c6babcd2a5cf1b6edcd19 Mon Sep 17 00:00:00 2001 From: Brad King Date: Fri, 11 Nov 2022 14:50:55 -0500 Subject: Tests: Fix CTest.UpdateGIT under repo-local defaultBranch config The default branch detection added by commit 26ec2e2b0c (Tests: Update CTest.UpdateGIT test for custom defaultBranch, 2020-12-02, v3.20.0-rc1~355^2) fails if the test is run inside a Git work tree whose `.git` directory configures a `defaultBranch` that is different from the global or system-wide value. Fix the detection to ignore the locally configured value so that we match the `git init` decision. --- Tests/CTestUpdateGIT.cmake.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Tests/CTestUpdateGIT.cmake.in b/Tests/CTestUpdateGIT.cmake.in index a3ef4eb..7fddaa3 100644 --- a/Tests/CTestUpdateGIT.cmake.in +++ b/Tests/CTestUpdateGIT.cmake.in @@ -34,7 +34,7 @@ endif() # Adapt to the system default branch name. execute_process( - COMMAND ${GIT} config --get init.defaultBranch + COMMAND ${GIT} --git-dir= config --get init.defaultBranch RESULT_VARIABLE defaultBranchFailed OUTPUT_VARIABLE defaultBranch ERROR_VARIABLE defaultBranchError -- cgit v0.12