pdev: corrections pour supporter nouvelle version de git

This commit is contained in:
Jephté Clain 2016-04-25 21:20:56 +04:00
parent 5d3e9fefd7
commit ded89be259
2 changed files with 7 additions and 3 deletions

View File

@ -624,7 +624,7 @@ function git_list_rbranches() {
function git_list_pbranches() {
# lister les branches locales et celles qui existent dans l'origine
# $1(=origin) et qui pourraient devenir une branche locale avec la commande
# git checkout
# git checkout -b
local prefix="${1:-origin}/"
{
git for-each-ref refs/heads/ --format='%(refname:short)'

8
pdev
View File

@ -138,7 +138,11 @@ if [ "$action" == sync ]; then
setx -a branches=list_feature_branches "$origin"
for branch in "${branches[@]}"; do
git_track_branch "$branch" "$origin"
if git_have_branch "$branch"; then
git_track_branch "$branch" "$origin"
else
git branch -t "$branch" "$origin/$branch"
fi
done
exit $?
@ -187,7 +191,7 @@ if [ "$action" == branch ]; then
if git_have_branch "$feature"; then
git checkout "$feature" || r=$?
elif git_have_rbranch "$feature" "$origin"; then
git checkout "$feature" || r=$?
git checkout -b "$feature" "$origin/$feature" || r=$?
else
estepn "\
Vous allez créer la nouvelle feature branch ${COULEUR_VERTE}$feature${COULEUR_NORMALE}