pu: autoriser fast-forward même en cas de modifications locales

This commit is contained in:
Jephte CLAIN 2016-02-15 21:09:30 +04:00
parent 1c397e8999
commit ad06535c8d
1 changed files with 3 additions and 9 deletions

View File

@ -466,16 +466,10 @@ function git_update() {
remote="$(git_get_branch_remote "$branch")"
rbranch="$(git_get_branch_rbranch "$branch" "$remote")"
pbranch="${rbranch#refs/remotes/}"
if [ -z "$remote" -o -z "$rbranch" ]; then
echo "Note: there are uncommitted local changes"
return 0
elif git_is_ancestor "$branch" "$rbranch"; then
echo "* Uncommitted changes, unwilling to fast-forward local branch $branch from $pbranch"
else
echo "* Cannot fast-forward local branch $branch from $pbranch"
echo " (and there are uncommitted local changes)"
if git merge -q --ff-only "$rbranch"; then
echo "* There are uncommitted local changes. Only current branch were updated"
echo " (CURRENT branch $branch were fast-forwarded from $pbranch)"
fi
echo "Try to merge manually with: git merge $pbranch"
return 0
fi