Fix unstable git checksums

Closes https://gitlab.archlinux.org/pacman/pacman/-/issues/131

(cherry picked from commit 9548d6cc76)
This commit is contained in:
Chih-Hsuan Yen 2024-04-30 17:24:37 +08:00 committed by Allan McRae
parent 3ad9366b26
commit 0828a085c1

View file

@ -68,6 +68,13 @@ download_git() {
warning "$(gettext "Failure while updating %s %s repo")" "${repo}" "git"
fi
fi
# Sanitize the cloned repo
# $GIT_DIR/info/attributes overrides .gitattributes, and thus no files in the repository
# can be altered by git features like export-subst or export-ignore
local MAKEPKG_GIT_DIR="$(git -C "$dir" rev-parse --absolute-git-dir)"
mkdir -p "$MAKEPKG_GIT_DIR/info"
echo "* -export-subst -export-ignore" > "$MAKEPKG_GIT_DIR/info/attributes"
}
extract_git() {