From 34b52c9a60e43d84a8ea3930a19f8cbfa5815931 Mon Sep 17 00:00:00 2001 From: Mohammad Alsaleh Date: Sun, 12 Aug 2012 00:24:43 +0000 Subject: makepkg: git clone instead of git fetch if $dir exists but empty Before this patch, makepkg would only check if $dir exists as an indication that a local clone exists. And if $dir does exist, makepkg will run git fetch inside it unconditionally. After applying this patch, makepkg will check if the existent $dir is empty. And if it is, it will be used to store a local clone. Signed-off-by: Mohammad Alsaleh --- scripts/makepkg.sh.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in index 270f9888..6c0e821c 100644 --- a/scripts/makepkg.sh.in +++ b/scripts/makepkg.sh.in @@ -396,7 +396,7 @@ download_git() { url=${url##*git+} url=${url%%#*} - if [[ ! -d "$dir" ]]; then + if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git" if ! git clone --mirror "$url" "$dir"; then error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git" -- cgit v1.2.3-70-g09d2