patch-git: Support git worktree

After “git worktree”, .git is a text file, not a directory.

Resolves: RHEL-121947
This commit is contained in:
Florian Weimer 2025-11-11 20:16:03 +01:00
parent b16cb36857
commit 50e34d07ff

View File

@ -487,7 +487,7 @@ local function generate_files()
-- True if %_sourcedir refers to a Git repository and git is installed.
local have_git = (posix == nil -- Not running under rpm.
or (posix.access('/usr/bin/git', 'x')
and posix.access(sourcedir .. '/.git/.', 'x')))
and posix.access(sourcedir .. '/.git', 'r')))
local commit_marker_contents -- For git_commit_file.
if have_git then
commit_marker_contents =