feat(feature): checkout from start point if exists

This commit is contained in:
vanpipy 2020-11-18 22:50:13 +08:00
parent 41732e4113
commit d3772eb469

View file

@ -32,6 +32,10 @@ do
--squash )
merge_mode="--squash"
;;
--from )
start_point=$2
shift
;;
* )
argv+=($1)
;;
@ -55,10 +59,24 @@ else
else
branch="$branch_prefix"/"${argv[0]}"
fi
if [[ -n $remote ]]
if [[ -n $remote ]] && [[ -z $start_point ]]
then
git create-branch -r $remote $branch
else
fi
if [[ -z $remote ]] && [[ -z $start_point ]]
then
git create-branch $branch
fi
if [[ -n $remote ]] && [[ -n $start_point ]]
then
git create-branch -r $remote --from $start_point $branch
fi
if [[ -z $remote ]] && [[ -n $start_point ]]
then
git create-branch --from $start_point $branch
fi
fi