summaryrefslogtreecommitdiffstats
path: root/bashrc
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2012-07-16 18:38:32 +0200
committerAlexander Sulfrian <alexander.sulfrian@fu-berlin.de>2012-07-16 18:38:32 +0200
commit004316ce2e007f423e0615825de05783fb9a0dd4 (patch)
treebd5bc3449a6de666e4f7884a1ccb9edd3128ee20 /bashrc
parent11fad8d13ac2a68ef576ee16591c2fcbadc7592b (diff)
downloaddotfiles-004316ce2e007f423e0615825de05783fb9a0dd4.tar.gz
dotfiles-004316ce2e007f423e0615825de05783fb9a0dd4.tar.xz
dotfiles-004316ce2e007f423e0615825de05783fb9a0dd4.zip
bashrc/main: no need for reset anymore
Diffstat (limited to 'bashrc')
-rw-r--r--bashrc/main.sh13
1 files changed, 4 insertions, 9 deletions
diff --git a/bashrc/main.sh b/bashrc/main.sh
index b02c29d..e5ba2d6 100644
--- a/bashrc/main.sh
+++ b/bashrc/main.sh
@@ -46,9 +46,8 @@ _self_update() {
if [[ $_merge != 'n' ]]; then
_local_changes="$(git status | grep '^# Change')"
_old_origin="$(git rev-list -n1 old-origin)"
- _old_head="$(git rev-list -n1 HEAD)"
- if [[ "$_old_origin" != "$_old_head" ]]; then
+ if [[ "$_old_origin" != "$(git rev-list -n1 HEAD)" ]]; then
echo -e "\033[31m*\033[0m You have some local commits. I will now try to rebase them"
echo " onto the new origin/master."
fi
@@ -59,16 +58,12 @@ _self_update() {
git stash >/dev/null || return
fi
- git reset --hard origin/master >/dev/null
-
# update old-origin
git tag -d old-origin >/dev/null 2>&1
- git tag old-origin origin-master >/dev/null 2>&1
+ git tag old-origin origin/master >/dev/null 2>&1
- if [[ "$_old_origin" != "$_old_head" ]]; then
- echo -e "\033[33m*\033[0m git rebase --onto HEAD $_old_origin $_old_head"
- git rebase --onto origin/master $_old_origin $_old_head || return
- fi
+ echo -e "\033[33m*\033[0m git rebase --onto origin/master $_old_origin"
+ git rebase --onto origin/master $_old_origin || return
if [[ -n "$_local_changes" ]]; then
git stash pop >/dev/null || return