Intégration de la branche verbose-update

This commit is contained in:
Jephté Clain 2015-06-04 22:14:02 +04:00
commit 4a15085d55
1 changed files with 18 additions and 1 deletions

View File

@ -461,7 +461,24 @@ function git_update() {
git fetch -p "$@" || return 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)" orig_branch="$(git_get_branch)"
array_from_lines branches "$(git_list_branches)" array_from_lines branches "$(git_list_branches)"
for branch in "${branches[@]}"; do for branch in "${branches[@]}"; do