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 <msal@i2pmail.org>
This commit is contained in:
parent
8f5ee72974
commit
34b52c9a60
1 changed files with 1 additions and 1 deletions
|
@ -396,7 +396,7 @@ download_git() {
|
||||||
url=${url##*git+}
|
url=${url##*git+}
|
||||||
url=${url%%#*}
|
url=${url%%#*}
|
||||||
|
|
||||||
if [[ ! -d "$dir" ]]; then
|
if [[ ! -d "$dir" ]] || dir_is_empty "$dir" ; then
|
||||||
msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git"
|
msg2 "$(gettext "Cloning %s %s repo...")" "${repo}" "git"
|
||||||
if ! git clone --mirror "$url" "$dir"; then
|
if ! git clone --mirror "$url" "$dir"; then
|
||||||
error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git"
|
error "$(gettext "Failure while downloading %s %s repo")" "${repo}" "git"
|
||||||
|
|
Loading…
Add table
Reference in a new issue