From 801f9af23d23d843a7e4a211b8a2c2176ca4afee Mon Sep 17 00:00:00 2001 From: Alejandro Mery Date: Thu, 17 Jul 2014 11:39:42 +0200 Subject: [PATCH] vcs_update: replace git pull with git merge Signed-off-by: Alejandro Mery --- files/bin/vcs_update | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/files/bin/vcs_update b/files/bin/vcs_update index a5634e0..97bcf7a 100755 --- a/files/bin/vcs_update +++ b/files/bin/vcs_update @@ -11,20 +11,29 @@ update_svn() { update_git() { local staged=false + local branch= remote= merge= cd "$1" || return 1 echo "== $PWD" - git fetch --all --prune - git remote | xargs -r git fetch --multiple --prune --tags + git fetch -q --all --prune + git remote | xargs -r git fetch -q --multiple --prune --tags if [ -n "$(git ls -md)" ]; then - if git stash; then + if git stash -q; then staged=true fi fi - git pull --rebase - ! $staged || git stash pop + + branch=`git branch | sed -ne 's!* \(.\)!\1!p'` + remote=`git config "branch.${branch}.remote"` + merge=`git config "branch.${branch}.merge"` + + git merge -q --stat --ff "$remote/${merge##refs/heads/}" + if $staged; then + git stash pop -q + git status -s + fi cd - > /dev/null }