pu: autoriser fast-forward même en cas de modifications locales
This commit is contained in:
parent
1c397e8999
commit
ad06535c8d
12
lib/ulib/vcs
12
lib/ulib/vcs
|
@ -466,16 +466,10 @@ function git_update() {
|
||||||
remote="$(git_get_branch_remote "$branch")"
|
remote="$(git_get_branch_remote "$branch")"
|
||||||
rbranch="$(git_get_branch_rbranch "$branch" "$remote")"
|
rbranch="$(git_get_branch_rbranch "$branch" "$remote")"
|
||||||
pbranch="${rbranch#refs/remotes/}"
|
pbranch="${rbranch#refs/remotes/}"
|
||||||
if [ -z "$remote" -o -z "$rbranch" ]; then
|
if git merge -q --ff-only "$rbranch"; then
|
||||||
echo "Note: there are uncommitted local changes"
|
echo "* There are uncommitted local changes. Only current branch were updated"
|
||||||
return 0
|
echo " (CURRENT branch $branch were fast-forwarded from $pbranch)"
|
||||||
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)"
|
|
||||||
fi
|
fi
|
||||||
echo "Try to merge manually with: git merge $pbranch"
|
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue