[pacman-dev] [PATCH libmakepkg 1/2] git: perform a shallow clone

Eric Engestrom eric at engestrom.ch
Fri Apr 29 21:26:56 UTC 2016


This can considerably speed up the cloning process, as makepkg won't
have to download the whole history.

Signed-off-by: Eric Engestrom <eric at engestrom.ch>
---
 scripts/libmakepkg/source/git.sh.in | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/libmakepkg/source/git.sh.in b/scripts/libmakepkg/source/git.sh.in
index cc27663..ad31c34 100644
--- a/scripts/libmakepkg/source/git.sh.in
+++ b/scripts/libmakepkg/source/git.sh.in
@@ -42,7 +42,7 @@ download_git() {
 
 	if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then
 		msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git"
-		if ! git clone --mirror "$url" "$dir"; then
+		if ! git clone --depth 1 --mirror "$url" "$dir"; then
 			error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git"
 			plain "$(gettext "Aborting...")"
 			exit 1
-- 
2.8.0


More information about the pacman-dev mailing list