From 9961e77d75052f41773f7ca2ec2c5a1928c0cb5f Mon Sep 17 00:00:00 2001
From: Pietro Incardona <incardon@mpi-cbg.de>
Date: Tue, 21 Feb 2017 19:55:45 +0100
Subject: [PATCH] Enabling update option

---
 script/update_openfpm | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/script/update_openfpm b/script/update_openfpm
index 376b2960..1bfdbc5f 100755
--- a/script/update_openfpm
+++ b/script/update_openfpm
@@ -28,24 +28,24 @@ function update_openfpm()
   if [ x"$branch" == x"$actual_branch" ]; then
 
    git remote update
-   git status -uno | grep "nothing to commit"
+   n_commit=$(git rev-list --count origin/$branch...$branch)
 
-    if [ $? -eq 0 ]; then
+    if [ $n_commit -eq 0 ]; then
       echo -e "\033[1m There are no-updates \033[0m"
       return
     fi
   fi
 
-#  git stash -u
-#  git submodule foreach 'git stash'
+  git stash -u
+  git submodule foreach 'git stash'
 
-#  git pull origin
-#  git checkout $branch
-#  git submodule update
+  git pull origin
+  git checkout $branch
+  git submodule update
 
-#  sh autogen.sh
-#  ./config.status
-#  make install
+  sh autogen.sh
+  ./config.status
+  make install
 
 }
 
-- 
GitLab