Skip to content

Commit

Permalink
Sparse clone exclude blob files
Browse files Browse the repository at this point in the history
  • Loading branch information
haiibo committed Jan 13, 2024
1 parent 333a91e commit 5a1645e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions diy-mini.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 更改默认 Shell 为 zsh
# sed -i 's/\/bin\/ash/\/usr\/bin\/zsh/g' package/base-files/files/etc/passwd

# TTYD 自动登录
# TTYD 免登录
# sed -i 's|/bin/login|/bin/login -f root|g' feeds/packages/utils/ttyd/files/ttyd.config

# 移除要替换的包
Expand All @@ -20,7 +20,7 @@ rm -rf feeds/luci/applications/luci-app-netdata
# Git稀疏克隆,只克隆指定目录到本地
function git_sparse_clone() {
branch="$1" repourl="$2" && shift 2
git clone --depth=1 -b $branch --single-branch --sparse $repourl
git clone --depth=1 -b $branch --single-branch --filter=blob:none --sparse $repourl
repodir=$(echo $repourl | awk -F '/' '{print $(NF)}')
cd $repodir && git sparse-checkout set $@
mv -f $@ ../package
Expand Down
4 changes: 2 additions & 2 deletions diy-script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# 更改默认 Shell 为 zsh
# sed -i 's/\/bin\/ash/\/usr\/bin\/zsh/g' package/base-files/files/etc/passwd

# TTYD 自动登录
# TTYD 免登录
# sed -i 's|/bin/login|/bin/login -f root|g' feeds/packages/utils/ttyd/files/ttyd.config

# 移除要替换的包
Expand All @@ -22,7 +22,7 @@ rm -rf feeds/luci/applications/luci-app-serverchan
# Git稀疏克隆,只克隆指定目录到本地
function git_sparse_clone() {
branch="$1" repourl="$2" && shift 2
git clone --depth=1 -b $branch --single-branch --sparse $repourl
git clone --depth=1 -b $branch --single-branch --filter=blob:none --sparse $repourl
repodir=$(echo $repourl | awk -F '/' '{print $(NF)}')
cd $repodir && git sparse-checkout set $@
mv -f $@ ../package
Expand Down

0 comments on commit 5a1645e

Please sign in to comment.