From 9a3e38051dc6293647d8a38665d3c843b1f769e0 Mon Sep 17 00:00:00 2001 From: whyour Date: Mon, 24 Apr 2023 14:46:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=85=8B=E9=9A=86=E4=BB=93=E5=BA=93=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=20depth?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docker/Dockerfile | 4 ++-- shell/share.sh | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index e06fbcab..f5015fd8 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -56,12 +56,12 @@ RUN set -x \ && rm -rf /root/.npm ARG SOURCE_COMMIT -RUN git clone -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \ +RUN git clone --depth=1 -b ${QL_BRANCH} ${QL_URL} ${QL_DIR} \ && cd ${QL_DIR} \ && cp -f .env.example .env \ && chmod 777 ${QL_DIR}/shell/*.sh \ && chmod 777 ${QL_DIR}/docker/*.sh \ - && git clone -b ${QL_BRANCH} https://github.com/${QL_MAINTAINER}/qinglong-static.git /static \ + && git clone --depth=1 -b ${QL_BRANCH} https://github.com/${QL_MAINTAINER}/qinglong-static.git /static \ && mkdir -p ${QL_DIR}/static \ && cp -rf /static/* ${QL_DIR}/static \ && rm -rf /static diff --git a/shell/share.sh b/shell/share.sh index c1e64115..1c06b183 100755 --- a/shell/share.sh +++ b/shell/share.sh @@ -315,7 +315,7 @@ git_clone_scripts() { echo -e "开始克隆仓库 $url 到 $dir\n" set_proxy "$proxy" - git clone $part_cmd $url $dir + git clone --depth=1 $part_cmd $url $dir exit_status=$? unset_proxy } @@ -329,8 +329,8 @@ git_pull_scripts() { echo -e "开始更新仓库:$dir_work" set_proxy "$proxy" - git fetch --all - git pull 1>/dev/null + git fetch --depth=1 --all + git pull --depth=1 1>/dev/null exit_status=$? unset_proxy