pcrone peut utiliser un répertoire existant

This commit is contained in:
Jephté Clain 2016-06-02 17:52:33 +04:00
parent e4b77298bc
commit 470d7cfe41
1 changed files with 13 additions and 2 deletions

View File

@ -293,7 +293,11 @@ elif [ "$CMD" == crone ]; then
setx destdir=basename -- "$path" setx destdir=basename -- "$path"
destdir="${destdir%.git}" destdir="${destdir%.git}"
fi fi
[ -d "$destdir" ] && die "$(ppath "$destdir"): répertoire existant" tmpdestdir=
if [ -d "$destdir" ]; then
[ -d "$destdir/.git" ] && die "$(ppath "$destdir"): répertoire existant"
ac_set_tmpdir tmpdestdir
fi
splituserhost "$userhost" user host splituserhost "$userhost" user host
[ -n "$user" ] || user=git [ -n "$user" ] || user=git
@ -303,7 +307,14 @@ elif [ "$CMD" == crone ]; then
use_ssh_wrapper use_ssh_wrapper
ssh "$userhost" create "$path" || die ssh "$userhost" create "$path" || die
if [ -n "$tmpdestdir" ]; then
setxx destname=abspath "$destdir" // basename
git clone "$userhost:$path" "$tmpdestdir/$destname" || die
mv "$tmpdestdir/$destname/.git" "$destdir" || die
ac_clean "$tmpdestdir"
else
git clone "$userhost:$path" "$destdir" || die git clone "$userhost:$path" "$destdir" || die
fi
git_annex_initial "$destdir" || die git_annex_initial "$destdir" || die
elif [ "$CMD" == xconfig-export ]; then elif [ "$CMD" == xconfig-export ]; then