summaryrefslogtreecommitdiff
path: root/eclass/git-r3.eclass
diff options
context:
space:
mode:
Diffstat (limited to 'eclass/git-r3.eclass')
-rw-r--r--eclass/git-r3.eclass18
1 files changed, 12 insertions, 6 deletions
diff --git a/eclass/git-r3.eclass b/eclass/git-r3.eclass
index de89fdc3a223..565f6ada8382 100644
--- a/eclass/git-r3.eclass
+++ b/eclass/git-r3.eclass
@@ -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)
;;