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")"
|
||||
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
|
||||
|
||||
|
|
Loading…
Reference in New Issue