utiliser la même logique que uproject pour cloner en mode devel

This commit is contained in:
Jephté Clain 2016-08-30 16:28:08 +04:00
parent 96afb2a10f
commit 5bef9b104a
5 changed files with 18 additions and 14 deletions

View File

@ -3,7 +3,7 @@
##@cooked nocomments
##@require base
uprovide runsmod
urequire base
urequire base vcs
function __runsmod_loadconf() {
# Charger le fichier de configuration $1. Les paramètres RUNSMOD_MODE,
@ -373,7 +373,11 @@ function __runsmod_clone_or_pull() {
if [ -n "$RUNSMOD_CLONE" ]; then
estepi "clone $(ppath "$repodir") [$repourl]"
mkdirof "$repodir"
git clone ${RUNSMOD_SHALLOW:+--depth 1} "$repourl" "$repodir"
git clone ${RUNSMOD_SHALLOW:+--depth 1} "$repourl" "$repodir" || return $?
if [ "$RUNSMOD_MODE" == devel ]; then
( cd "$repodir"; git_have_rbranch develop && git checkout develop ) || return $?
fi
git_annex_initial "$repodir" || return $?
return $?
else
estepe "noclone $(ppath "$repodir")"

View File

@ -3,7 +3,7 @@
##@cooked nocomments
##@require base
uprovide vcs
urequire base
urequire ulib base
################################################################################
# Général
@ -772,6 +772,14 @@ function git_is_merged() {
}
# fonctions pour git annex
function git_annex_use_ssh_wrapper() {
__UTOOLS_FORCE_PATH="$PATH"
__UTOOLS_FORCE_SSH="${GIT_SSH:-ssh}"
export __UTOOLS_FORCE_PATH __UTOOLS_FORCE_SSH
udelpath "$ULIBDIR/support/ssh-wrapper" __UTOOLS_FORCE_PATH
uinspath "$ULIBDIR/support/ssh-wrapper" PATH
}
function git_annex_initial() {
# sur le dépôt $1 fraichement cloné, vérifier s'il faut faire git annex
# init. Si oui, l'initialiser avec le nom d'hôte, et récupérer tous les

View File

@ -217,14 +217,6 @@ done
################################################################################
# Traiter les commandes
function use_ssh_wrapper() {
__UTOOLS_FORCE_PATH="$PATH"
__UTOOLS_FORCE_SSH="${GIT_SSH:-ssh}"
export __UTOOLS_FORCE_PATH __UTOOLS_FORCE_SSH
udelpath "$scriptdir/lib/ssh-wrapper" __UTOOLS_FORCE_PATH
uinspath "$scriptdir/lib/ssh-wrapper" PATH
}
if [ "$CMD" == "grep" ]; then
## grep
if [ $# -eq 1 -a "$1" == "--help" ]; then
@ -259,7 +251,7 @@ elif array_contains GITANNEX_CMDS "$CMD"; then
git annex sync
fi
}
use_ssh_wrapper
git_annex_use_ssh_wrapper
case "$CMD" in
annex) git annex "$@";;
xsync) xsync;;
@ -280,7 +272,7 @@ elif [ "$CMD" == clone ]; then
fi
[ -d "$destdir" ] && die "$(ppath "$destdir"): répertoire existant"
use_ssh_wrapper
git_annex_use_ssh_wrapper
git clone "$repourl" "$destdir" || die
( cd "$destdir"; git_have_rbranch develop && git checkout develop ) || die
git_annex_initial "$destdir" || die
@ -307,7 +299,7 @@ elif [ "$CMD" == crone ]; then
userhost="$user@$host"
[ -n "$path" ] || die "Vous devez spécifier le chemin du dépôt git"
use_ssh_wrapper
git_annex_use_ssh_wrapper
ssh "$userhost" create "$path" || die
if [ -n "$tmpdestdir" ]; then
setxx destname=abspath "$destdir" // basename