summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/git.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/include/git.sh b/include/git.sh
index ba58a5ba..ff8b0d97 100644
--- a/include/git.sh
+++ b/include/git.sh
@@ -100,18 +100,20 @@ fetch_submodule()
tmpclone()
{
- repodir="repo/${1##*/}"
+ repodir="repo/${1##*/}" && [ $# -gt 5 ] && repodir="$3"
x_ mkdir -p "repo"
- if [ -d "$repodir" ]; then
+ if [ -d "$repodir" ] && [ $# -lt 6 ]; then
git -C "$repodir" pull || sleep 3 || git -C "$repodir" pull \
|| sleep 3 || git -C "$repodir" pull :
else
git clone $1 "$repodir" || git clone $2 "$repodir" || \
$err "!clone $1 $2 $repodir $4 $5"
fi
- git clone "$repodir" "$3" || $err "!clone $repodir $3"
+ (
+ [ $# -gt 5 ] || git clone "$repodir" "$3" || $err "!clone $repodir $3"
git -C "$3" reset --hard "$4" || $err "!reset $1 $2 $3 $4 $5"
git_am_patches "$3" "$5"
+ ) || [ $# -gt 5 ] || tmpclone $@ retry; :
}
git_am_patches()