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 if [ -z "$UTOOLS_VCS_OFFLINE" ]; then
git_track_branch "$feature" "$origin" git_track_branch "$feature" "$origin"
fi fi
git_fast_forward "$feature" "" "$origin"
exit 0 exit 0
fi fi
# Créer/basculer vers une feature branch # Créer/basculer vers une feature branch
git_ensure_cleancheckout git_ensure_cleancheckout
r=0
if git_have_branch "$feature"; then if git_have_branch "$feature"; then
git checkout "$feature" git checkout "$feature" || r=$?
else else
estepn "\ estepn "\
Vous allez créer la nouvelle feature branch ${COULEUR_VERTE}$feature${COULEUR_NORMALE} 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" git_ensure_branch "$feature" "$source" "$origin"
[ $? -eq 2 ] && die "Impossible de créer la branche $feature. Veuillez vérifier que la branche $source existe" [ $? -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 fi
exit $? exit $?