pman: tenir compte des branches distantes
This commit is contained in:
parent
e129e0aa7f
commit
882549375c
21
bin/pman
21
bin/pman
@ -97,7 +97,12 @@ function _ensure_main_branch() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function checkout_main_action() {
|
function checkout_main_action() {
|
||||||
_ensure_main_branch
|
if [ -z "$MainBranch" ]; then
|
||||||
|
array_contains AllBranches "$MAIN" && exit_with enote "\
|
||||||
|
$MAIN: une branche du même nom existe dans l'origine
|
||||||
|
git checkout $MAIN"
|
||||||
|
_ensure_main_branch
|
||||||
|
fi
|
||||||
git checkout -q "$MAIN"
|
git checkout -q "$MAIN"
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -110,6 +115,9 @@ function init_develop_action() {
|
|||||||
local -a push_branches
|
local -a push_branches
|
||||||
|
|
||||||
if [ -z "$DevelopBranch" ]; then
|
if [ -z "$DevelopBranch" ]; then
|
||||||
|
array_contains AllBranches "$DEVELOP" && exit_with enote "\
|
||||||
|
$DEVELOP: une branche du même nom existe dans l'origine
|
||||||
|
git checkout $DEVELOP"
|
||||||
_ensure_main_branch
|
_ensure_main_branch
|
||||||
_ensure_develop_branch
|
_ensure_develop_branch
|
||||||
|
|
||||||
@ -136,6 +144,9 @@ function init_upstream_action() {
|
|||||||
local -a push_branches; local config
|
local -a push_branches; local config
|
||||||
|
|
||||||
if [ -z "$UpstreamBranch" ]; then
|
if [ -z "$UpstreamBranch" ]; then
|
||||||
|
array_contains AllBranches "$UPSTREAM" && exit_with enote "\
|
||||||
|
$UPSTREAM: une branche du même nom existe dans l'origine
|
||||||
|
git checkout $UPSTREAM"
|
||||||
_ensure_develop_branch
|
_ensure_develop_branch
|
||||||
_ensure_upstream_branch
|
_ensure_upstream_branch
|
||||||
|
|
||||||
@ -178,6 +189,9 @@ function init_dist_action() {
|
|||||||
local -a push_branches
|
local -a push_branches
|
||||||
|
|
||||||
if [ -z "$DistBranch" ]; then
|
if [ -z "$DistBranch" ]; then
|
||||||
|
array_contains AllBranches "$DIST" && exit_with enote "\
|
||||||
|
$DIST: une branche du même nom existe dans l'origine
|
||||||
|
git checkout $DIST"
|
||||||
_ensure_main_branch
|
_ensure_main_branch
|
||||||
_ensure_dist_branch
|
_ensure_dist_branch
|
||||||
|
|
||||||
@ -203,7 +217,10 @@ function init_feature_action() {
|
|||||||
[ -n "$branch" ] || die "Vous devez spécifier le nom de la branche"
|
[ -n "$branch" ] || die "Vous devez spécifier le nom de la branche"
|
||||||
branch="$FEATURE$branch"
|
branch="$FEATURE$branch"
|
||||||
|
|
||||||
if ! array_contains AllBranches "$branch"; then
|
if ! array_contains LocalBranches "$branch"; then
|
||||||
|
array_contains AllBranches "$branch" && exit_with enote "\
|
||||||
|
$branch: une branche du même nom existe dans l'origine
|
||||||
|
git checkout $branch"
|
||||||
_ensure_develop_branch
|
_ensure_develop_branch
|
||||||
|
|
||||||
resolve_should_push
|
resolve_should_push
|
||||||
|
Loading…
Reference in New Issue
Block a user