Skip to content

Commit

Permalink
git-r3.eclass: Add checkout dirs as "safe" directories
Browse files Browse the repository at this point in the history
Mark all checkout directories as "safe" to avoid dubious ownership
errors with newer git versions when the checkout directory is accessed
from src_install().

Closes: https://bugs.gentoo.org/879353
Closes: #28154
Signed-off-by: Michał Górny <mgorny@gentoo.org>
  • Loading branch information
mgorny committed Nov 7, 2022
1 parent 8631f1d commit 207a50d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions eclass/git-r3.eclass
Expand Up @@ -887,6 +887,11 @@ git-r3_checkout() {
cp "${orig_repo}"/packed-refs "${GIT_DIR}"/packed-refs || die
fi

# mark this directory as "safe" so that src_install() can access it
# https://bugs.gentoo.org/879353
git config --global --add safe.directory \
"$(cd "${out_dir}" && echo "${PWD}")" || die

# (no need to copy HEAD, we will set it via checkout)

if [[ -f ${orig_repo}/shallow ]]; then
Expand Down

0 comments on commit 207a50d

Please sign in to comment.