Skip to content

Commit e699cbe

Browse files
authored
Fix proxy-verifier path for non-worktree repositories (#12699)
The git rev-parse --git-common-dir command added in #12686 returns an absolute path to the relevant .git direcotry for worktrees. Unfortunately, it does a relative path for "regular" non-worktree clones. Without converting to an absolute path, PROXY_VERIFIER_PATH becomes relative and fails to resolve correctly when passed to autest. This adds get_filename_component to ensure GIT_COMMON_DIR is always absolute, fixing the issue for both repository types.
1 parent a31fea8 commit e699cbe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

cmake/proxy-verifier.cmake

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ if(NOT GIT_RESULT EQUAL 0)
4747
message(FATAL_ERROR "Failed to determine git common directory")
4848
endif()
4949

50+
# Convert to absolute path (handles relative .git from regular non-worktree clones).
51+
get_filename_component(GIT_COMMON_DIR "${GIT_COMMON_DIR}" ABSOLUTE BASE_DIR "${CMAKE_SOURCE_DIR}")
52+
5053
# Download proxy-verifier to git common directory.
5154
set(PV_ARCHIVE ${GIT_COMMON_DIR}/proxy-verifier/proxy-verifier.tar.gz)
5255
file(

0 commit comments

Comments
 (0)