pu: afficher un message s'il y a des modifications locales
This commit is contained in:
parent
2870071b8b
commit
8a2756125a
19
lib/ulib/vcs
19
lib/ulib/vcs
|
@ -461,7 +461,24 @@ function git_update() {
|
|||
|
||||
git fetch -p "$@" || return
|
||||
|
||||
git_check_cleancheckout || return 0
|
||||
if ! git_check_cleancheckout; then
|
||||
branch="$(git_get_branch)"
|
||||
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)"
|
||||
fi
|
||||
echo "Try to merge manually with: git merge $pbranch"
|
||||
return 0
|
||||
fi
|
||||
|
||||
orig_branch="$(git_get_branch)"
|
||||
array_from_lines branches "$(git_list_branches)"
|
||||
for branch in "${branches[@]}"; do
|
||||
|
|
Loading…
Reference in New Issue