Browse Source

vcs_update: replace git pull with git merge

Signed-off-by: Alejandro Mery <amery@geeks.cl>
master
Alejandro Mery 10 years ago
parent
commit
801f9af23d
1 changed files with 14 additions and 5 deletions
  1. +14
    -5
      files/bin/vcs_update

+ 14
- 5
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
}

Loading…
Cancel
Save