summaryrefslogtreecommitdiffstats
path: root/Tests
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2022-11-11 19:50:55 (GMT)
committerBrad King <brad.king@kitware.com>2022-11-11 20:05:01 (GMT)
commitb0d16c7f7404bfa9979680b5bb4994441a6c0faa (patch)
tree125c39913d7723bcf9b5c8a407af2da211f7ab72 /Tests
parent31893e8c8f580d6a94fc70b85e8cae47300cc6c0 (diff)
downloadCMake-b0d16c7f7404bfa9979680b5bb4994441a6c0faa.zip
CMake-b0d16c7f7404bfa9979680b5bb4994441a6c0faa.tar.gz
CMake-b0d16c7f7404bfa9979680b5bb4994441a6c0faa.tar.bz2
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.
Diffstat (limited to 'Tests')
-rw-r--r--Tests/CTestUpdateGIT.cmake.in2
1 files changed, 1 insertions, 1 deletions
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