diff --git a/CHANGES.txt b/CHANGES.txt index 41e8f15..6bfd776 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,8 @@ +## Version 1.16.0 du 04/06/2015-22:14 + +4a15085 Intégration de la branche verbose-update +8a27561 pu: afficher un message s'il y a des modifications locales + ## Version 1.15.0 du 22/05/2015-17:03 e715087 Intégration de la branche update-upassword diff --git a/VERSION.txt b/VERSION.txt index 141f2e8..15b989e 100644 --- a/VERSION.txt +++ b/VERSION.txt @@ -1 +1 @@ -1.15.0 +1.16.0 diff --git a/lib/ulib/vcs b/lib/ulib/vcs index 9e7ccd0..2eb9fe6 100644 --- a/lib/ulib/vcs +++ b/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