mirror of
https://github.com/flatcar/scripts.git
synced 2026-05-04 19:56:32 +02:00
eclass/git-r3: Sync with Gentoo
It's from Gentoo commit 838b52b4a3e44aaa2b86db7c68803d0018cfba98.
This commit is contained in:
parent
dd30011130
commit
e514342a46
@ -1,4 +1,4 @@
|
||||
# Copyright 1999-2023 Gentoo Authors
|
||||
# Copyright 1999-2024 Gentoo Authors
|
||||
# Distributed under the terms of the GNU General Public License v2
|
||||
|
||||
# @ECLASS: git-r3.eclass
|
||||
@ -429,6 +429,7 @@ _git-r3_set_submodules() {
|
||||
|
||||
l=${l#submodule.}
|
||||
local subname=${l%%.url=*}
|
||||
local is_manually_specified=
|
||||
|
||||
# filter out on EGIT_SUBMODULES
|
||||
if declare -p EGIT_SUBMODULES &>/dev/null; then
|
||||
@ -449,13 +450,14 @@ _git-r3_set_submodules() {
|
||||
continue
|
||||
else
|
||||
einfo "Using submodule ${parent_path}${subname}"
|
||||
is_manually_specified=1
|
||||
fi
|
||||
fi
|
||||
|
||||
# skip modules that have 'update = none', bug #487262.
|
||||
local upd=$(echo "${data}" | git config -f /dev/fd/0 \
|
||||
submodule."${subname}".update)
|
||||
[[ ${upd} == none ]] && continue
|
||||
[[ ${upd} == none && ! ${is_manually_specified} ]] && continue
|
||||
|
||||
# https://github.com/git/git/blob/master/refs.c#L31
|
||||
# we are more restrictive than git itself but that should not
|
||||
@ -813,13 +815,17 @@ git-r3_fetch() {
|
||||
|
||||
if [[ ${EGIT_LFS} ]]; then
|
||||
# Fetch the LFS files from the current ref (if any)
|
||||
local lfs_fetch_command=( git lfs fetch "${r}" )
|
||||
local lfs_fetch_command=( git lfs fetch "${r}" "${remote_ref}" )
|
||||
|
||||
case "${EGIT_LFS_CLONE_TYPE}" in
|
||||
shallow)
|
||||
lfs_fetch_command+=(
|
||||
--prune
|
||||
)
|
||||
if [[ -d ${GIT_DIR}/lfs/objects ]] && ! rmdir "${GIT_DIR}"/lfs/objects 2> /dev/null; then
|
||||
# Only prune if the lfs directory is not empty.
|
||||
# The prune command can take a very long time to resolve even if there are no lfs objects.
|
||||
lfs_fetch_command+=(
|
||||
--prune
|
||||
)
|
||||
fi
|
||||
;;
|
||||
single)
|
||||
;;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user