mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-15 12:03:31 +01:00
pgit.sh: Support --login
In the move away from environment variables, replace JANWARE_USER support in pgit.sh by the --login option. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
d047ad650c
commit
f9f0041790
2 changed files with 15 additions and 8 deletions
|
|
@ -101,9 +101,9 @@ clone()
|
|||
}
|
||||
|
||||
local p
|
||||
local whoami="$(id -un)"
|
||||
config
|
||||
cd $pdir
|
||||
local login=$JANWARE_USER
|
||||
local projects="$PGIT_CLONE_PROJECTS"
|
||||
local ignore="$PGIT_IGNORE"
|
||||
local thisdir="${0%/*}"
|
||||
|
|
@ -112,6 +112,8 @@ clone()
|
|||
local long_opts="create-remote-user-repos"
|
||||
local refspec=()
|
||||
long_opts="$long_opts,refspec:"
|
||||
local login="$whoami"
|
||||
long_opts="$long_opts,login:"
|
||||
|
||||
local opts
|
||||
opts=$(getopt -o C --long "$long_opts" -n clone -- "$@") || fatal "Failed to parse options $@"
|
||||
|
|
@ -125,6 +127,10 @@ clone()
|
|||
refspec=(${2//:/ })
|
||||
shift
|
||||
;;
|
||||
--login)
|
||||
login="$2"
|
||||
shift
|
||||
;;
|
||||
*)
|
||||
fatal "Unknown option $1"
|
||||
;;
|
||||
|
|
@ -136,8 +142,6 @@ clone()
|
|||
local fromuser="${refspec[0]}"
|
||||
local fromref="${refspec[1]}"
|
||||
local toref="${refspec[2]}"
|
||||
local whoami="$(id -un)"
|
||||
[ "$login" ] || login=$whoami
|
||||
[ "$fromuser" ] || fromuser=$whoami
|
||||
[ "$fromref" ] || fromref=master
|
||||
local git_srv_admin="$SSH $login@git.janware.com /opt/jw-build/bin/git-srv-admin.sh"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue