Browse Source

sde-update-tree: auto-stash (and restore) local changes on update before the rebase

stable/0.6
Alejandro Mery 11 years ago
parent
commit
81792c7e27
1 changed files with 11 additions and 2 deletions
  1. +11
    -2
      bin/sde-update-tree

+ 11
- 2
bin/sde-update-tree

@ -3,7 +3,7 @@
# This copyright note is auto-generated by ./scripts/Create-CopyPatch.
#
# Filename: bin/sde-update-tree
# Copyright (C) 2007 - 2009 The OpenSDE Project
# Copyright (C) 2007 - 2013 The OpenSDE Project
#
# More information can be found in the files COPYING and README.
#
@ -63,6 +63,7 @@ update_git()
local remote="$(git config branch.$branch.remote)"
local remote_list="$(git remote)"
local remote_branch= remote_branch_list=
local changes=false
if [ -z "$remote_list" ]; then
echo_warning "$prefix: no remotes set"
@ -97,9 +98,17 @@ update_git()
echo_info "$prefix:"
fi
if git reset; then
if git reset -q; then
git remote prune "$remote"
if [ -n "$(git ls-files -md)" ]; then
changes=true
git stash > /dev/null
fi
git pull --rebase
if $changes; then
git stash pop > /dev/null
git status --porcelain
fi
fi
if [ -x "./update.sh" ]; then

Loading…
Cancel
Save