pgit.sh: Add distinction between CLONE_FROM_USER and PGIT_LOGIN

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2016-11-17 22:35:42 +00:00
commit 0e52bbcc42

View file

@ -53,11 +53,13 @@ clone()
local p
config
cd $pdir
local id=$PGIT_CLONE_FROM_USER
local fromuser=$PGIT_CLONE_FROM_USER
local login=$PGIT_LOGIN
local projects="$PGIT_CLONE_PROJECTS"
[ "$id" ] || id=`whoami`
[ "$login" ] || login=`whoami`
[ "$fromuser" ] || fromuser=`whoami`
if [ -z "$projects" ]; then
projects=`$SSH git.jannet.de /opt/ytools/bin/git-srv-admin.sh -u $id -j list-personal-projects`
projects=`$SSH git.jannet.de /opt/ytools/bin/git-srv-admin.sh -u $fromuser -j list-personal-projects`
[ "$?" != 0 ] && exit 1
fi
set -e
@ -67,7 +69,7 @@ clone()
continue
}
marker "cloning $p"
git clone ssh://$id@git.jannet.de/srv/git/$id/proj/$p
git clone ssh://$login@git.jannet.de/srv/git/$fromuser/proj/$p
git -C $p submodule init || fatal git submodule init failed in `pwd`
git -C $p submodule update || fatal git submodule update failed in `pwd`
done