]> git.lyx.org Git - features.git/commitdiff
Report if the git tree is not clean before we do anything.
authorRichard Heck <rgheck@comcast.net>
Mon, 20 Jun 2011 14:46:30 +0000 (14:46 +0000)
committerRichard Heck <rgheck@comcast.net>
Mon, 20 Jun 2011 14:46:30 +0000 (14:46 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@39147 a592a061-630c-0410-9148-cb99ea01b6c8

development/tools/update-po.sh

index e39f712532adae27365d568c28c17dc641601205..ed972c4ed2667aaf69cd06ceac515b5ea0a23b0a 100644 (file)
@@ -56,6 +56,15 @@ if svn log >/dev/null 2>&1; then
   VCS="svn";
 elif git diff >/dev/null 2>&1; then
   VCS="git";
+  # We need to make sure that we have a tree without any unpushed 
+  # commits. Otherwise git svn dcommit would commit more than we
+  # want.
+  if git status | grep -Pq 'Your branch is (?:ahead|behind)'; then
+    echo "Your git tree is not clean. Please correct the situation and re-run.";
+    echo;
+    git status;
+    exit 10;
+  fi
 fi
 
 if [ -z "$VCS" ]; then 
@@ -118,17 +127,8 @@ fi
 if [ "$VCS" = "svn" ]; then
   $DEBUG svn ci *.po;
 else
-  # We need to make sure that we have a tree without any unpushed 
-  # commits. Otherwise git svn dcommit would commit more than we
-  # want.
-  NOTSAFE="";
-  if git status | grep -Pq 'Your branch is (?:ahead|behind)'; then
-    NOTSAFE="TRUE";
-  fi
   $DEBUG git commit *.po -m "Remerge strings.";
-  if [ -z "$NOTSAFE" ]; then
-    $DEBUG git svn dcommit;
-  fi
+  $DEBUG git svn dcommit;
 fi
 
 echo