diff --git a/lib/ulib/vcs b/lib/ulib/vcs index 84dbf35..82992e2 100644 --- a/lib/ulib/vcs +++ b/lib/ulib/vcs @@ -676,7 +676,14 @@ function git_track_branch() { if ! git_have_rbranch "$branch" "$origin"; then git push "$origin" "$branch" || return fi - git branch -t --set-upstream "$branch" "$origin/$branch" + local version="$(LANG=C git version)" + version="${version#git version }" + eval "version=(${version//./ })" + if [ ${version[0]} -le 1 -a ${version[1]} -le 7 ]; then + git branch -t --set-upstream "$branch" "$origin/$branch" + else + git branch -u "$origin/$branch" "$branch" + fi } function git_ensure_branch() { # retourner 0 si la branche a été créée, 1 si elle existait déjà, 2 en cas d'erreur