scripts/feeds: use partial clone for src-git-full

Partial clone is much faster without clipping history

Signed-off-by: Glen Huang <me@glenhuang.com>
[also apply to include/download.mk]
Signed-off-by: Tianling Shen <cnsztl@immortalwrt.org>
(cherry picked from commit 31514777275184fd0f41d7af9eb1a92ecff37802)
This commit is contained in:
Glen Huang 2023-04-22 13:22:28 +08:00 committed by Tianling Shen
parent 5c1af46f28
commit f6932e9bd5
No known key found for this signature in database
GPG Key ID: 6850B6345C862176
2 changed files with 5 additions and 5 deletions

View File

@ -203,9 +203,9 @@ define DownloadMethod/rawgit
cd $(TMP_DIR)/dl && \
rm -rf $(SUBDIR) && \
[ \! -d $(SUBDIR) ] && \
git clone $(OPTS) $(URL) $(SUBDIR) && \
git clone --filter=blob:none $(OPTS) $(URL) $(SUBDIR) && \
(cd $(SUBDIR) && git checkout $(VERSION) && \
git submodule update --init --recursive) && \
git submodule update --init --recursive --filter=blob:none) && \
echo "Packing checkout..." && \
export TAR_TIMESTAMP=`cd $(SUBDIR) && git log -1 --format='@%ct'` && \
rm -rf $(SUBDIR)/.git && \

View File

@ -164,9 +164,9 @@ my %update_method = (
'controldir' => ".git",
'revision' => "git rev-parse --short HEAD | tr -d '\n'"},
'src-git-full' => {
'init' => "git clone '%s' '%s'",
'init_branch' => "git clone --branch '%s' '%s' '%s'",
'init_commit' => "git clone '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -",
'init' => "git clone --filter=blob:none '%s' '%s'",
'init_branch' => "git clone --filter=blob:none --branch '%s' '%s' '%s'",
'init_commit' => "git clone --filter=blob:none '%s' '%s' && cd '%s' && git checkout -b '%s' '%s' && cd -",
'update' => "git pull --ff-only",
'update_force' => "git pull --ff-only || (git reset --hard HEAD; git pull --ff-only; exit 1)",
'post_update' => "git submodule update --init --recursive",