git_track_branch(): support de git >= 1.8.x
This commit is contained in:
parent
130b4d1618
commit
2f60fece01
|
@ -676,7 +676,14 @@ function git_track_branch() {
|
||||||
if ! git_have_rbranch "$branch" "$origin"; then
|
if ! git_have_rbranch "$branch" "$origin"; then
|
||||||
git push "$origin" "$branch" || return
|
git push "$origin" "$branch" || return
|
||||||
fi
|
fi
|
||||||
|
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"
|
git branch -t --set-upstream "$branch" "$origin/$branch"
|
||||||
|
else
|
||||||
|
git branch -u "$origin/$branch" "$branch"
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
function git_ensure_branch() {
|
function git_ensure_branch() {
|
||||||
# retourner 0 si la branche a été créée, 1 si elle existait déjà, 2 en cas d'erreur
|
# retourner 0 si la branche a été créée, 1 si elle existait déjà, 2 en cas d'erreur
|
||||||
|
|
Loading…
Reference in New Issue