option -n pour pcrone le clone pas le dépôt nouvellement créé
This commit is contained in:
parent
01325d0c23
commit
f72dd86584
28
uproject
28
uproject
|
@ -494,6 +494,11 @@ NR <= 2 { next }
|
|||
fi
|
||||
|
||||
elif [ "$CMD" == crone ]; then
|
||||
no_clone=
|
||||
parse_opts "${PRETTYOPTS[@]}" \
|
||||
-n,--no-clone no_clone=1 \
|
||||
@ args -- "$@" && set -- "${args[@]}" || die "$args"
|
||||
|
||||
cxone_init "$@"
|
||||
[ -n "$repourl" ] || die "Vous devez spécifier l'url du dépôt git"
|
||||
|
||||
|
@ -533,7 +538,7 @@ elif [ "$CMD" == crone ]; then
|
|||
destdir="${destdir%.git}"
|
||||
fi
|
||||
tmpdestdir=
|
||||
if [ -d "$destdir" ]; then
|
||||
if [ -d "$destdir" -a -z "$no_clone" ]; then
|
||||
[ -d "$destdir/.git" ] && die "$(ppath2 "$destdir"): un dépôt existe déjà"
|
||||
ac_set_tmpdir tmpdestdir
|
||||
fi
|
||||
|
@ -542,6 +547,8 @@ elif [ "$CMD" == crone ]; then
|
|||
setx result=curl -fs "$hostuser/create?$path" || die
|
||||
echo "$result"
|
||||
[[ "$result" == FATAL:* ]] && die
|
||||
[ -n "$no_clone" ] && exit 0
|
||||
|
||||
if [ -n "$tmpdestdir" ]; then
|
||||
setxx destname=abspath "$destdir" // basename
|
||||
git clone "$hostuser/$path" "$tmpdestdir/$destname" || die
|
||||
|
@ -550,9 +557,12 @@ elif [ "$CMD" == crone ]; then
|
|||
else
|
||||
git clone "$hostuser/$path" "$destdir" || die
|
||||
fi
|
||||
|
||||
elif [ "$mode" == gitolite_ssh ]; then
|
||||
git_annex_use_ssh_wrapper
|
||||
ssh "$userhost" create "$path" || die
|
||||
[ -n "$no_clone" ] && exit 0
|
||||
|
||||
if [ -n "$tmpdestdir" ]; then
|
||||
setxx destname=abspath "$destdir" // basename
|
||||
git clone "$userhost:$path" "$tmpdestdir/$destname" || die
|
||||
|
@ -561,6 +571,7 @@ elif [ "$CMD" == crone ]; then
|
|||
else
|
||||
git clone "$userhost:$path" "$destdir" || die
|
||||
fi
|
||||
|
||||
elif [ "$mode" == gogs_http ]; then
|
||||
payload='{"private":true,"name":"'"$path"'"}'
|
||||
if [ "$gogs_user" != "$user" ]; then
|
||||
|
@ -576,6 +587,8 @@ url: $url
|
|||
payload: $payload
|
||||
result: $result"
|
||||
echo "$result"
|
||||
[ -n "$no_clone" ] && exit 0
|
||||
|
||||
if [ -n "$tmpdestdir" ]; then
|
||||
setxx destname=abspath "$destdir" // basename
|
||||
git clone "$repourl" "$tmpdestdir/$destname" || die
|
||||
|
@ -587,18 +600,17 @@ result: $result"
|
|||
else
|
||||
die "bug: mode non prévu"
|
||||
fi
|
||||
if [ ! -f "$destdir/.gitignore" -o ! -f "$destdir/.gitattributes" ]; then
|
||||
if ask_yesno "Voulez-vous créer les fichiers initiaux .gitignore et/ou .gitattributes?" O; then
|
||||
|
||||
if [ -f "$destdir/.gitignore" ]; then
|
||||
einfo "Refus d'écraser le fichier .gitignore existant"
|
||||
else
|
||||
:
|
||||
elif ask_yesno "Voulez-vous créer le fichier initial .gitignore?" O; then
|
||||
echo >"$destdir/.gitignore" "\
|
||||
.~lock*#
|
||||
.*.swp"
|
||||
fi
|
||||
if [ -f "$destdir/.gitattributes" ]; then
|
||||
einfo "Refus d'écraser le fichier .gitattributes existant"
|
||||
else
|
||||
:
|
||||
elif ask_yesno "Voulez-vous créer le fichier initial .gitattributes?" N; then
|
||||
echo >"$destdir/.gitattributes" "\
|
||||
*.zip -delta
|
||||
*.gz -delta
|
||||
|
@ -606,8 +618,6 @@ result: $result"
|
|||
*.whl -delta
|
||||
*.exe -delta"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
elif [ "$CMD" == xconfig-export ]; then
|
||||
unset GIT_DIR; unset GIT_WORK_TREE
|
||||
|
|
Loading…
Reference in New Issue