fast-forwarder automatiquement la branche vers laquelle on bascule

This commit is contained in:
Jephté Clain 2015-03-27 00:16:03 +04:00
parent e3e3bbb9ed
commit 743e17ba0f
1 changed files with 8 additions and 2 deletions

10
pdev
View File

@ -123,13 +123,15 @@ if [ "$action" == branch ]; then
if [ -z "$UTOOLS_VCS_OFFLINE" ]; then
git_track_branch "$feature" "$origin"
fi
git_fast_forward "$feature" "" "$origin"
exit 0
fi
# Créer/basculer vers une feature branch
git_ensure_cleancheckout
r=0
if git_have_branch "$feature"; then
git checkout "$feature"
git checkout "$feature" || r=$?
else
estepn "\
Vous allez créer la nouvelle feature branch ${COULEUR_VERTE}$feature${COULEUR_NORMALE}
@ -138,7 +140,11 @@ Vous allez créer la nouvelle feature branch ${COULEUR_VERTE}$feature${COULEUR_N
git_ensure_branch "$feature" "$source" "$origin"
[ $? -eq 2 ] && die "Impossible de créer la branche $feature. Veuillez vérifier que la branche $source existe"
git checkout "$feature"
git checkout "$feature" || r=$?
fi
if [ "$r" -eq 0 ]; then
# éventuellement fast-forwarder automatiquement
git_fast_forward "$feature" "" "$origin"
fi
exit $?