[PATCH v2] release.sh: use git-diff --quiet instead of git status

Peter Hutterer peter.hutterer at who-t.net
Tue May 11 17:19:19 PDT 2010


git status in git-1.7 always returns 0, regardless of the number of
uncommitted changes [1]. This breaks the current script. Replace with a git
diff --quiet HEAD instead, that's sufficient for our use-case here.

[1] commit 9e4b7ab6525 "git status: not "commit --dry-run" anymore"
    in the git source tree

Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 release.sh |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)

diff --git a/release.sh b/release.sh
index c8461fc..ec52f9a 100755
--- a/release.sh
+++ b/release.sh
@@ -124,15 +124,10 @@ done
 # Check for uncommitted/queued changes.
 if [ "x$ignorechanges" != "x1" ]; then
     set +e
-    git diff --exit-code > /dev/null 2>&1
+    git diff --quiet HEAD > /dev/null 2>&1
     if [ $? -ne 0 ]; then
         abort_for_changes
     fi
-
-    git status > /dev/null 2>&1
-    if [ $? -eq 0 ]; then
-        abort_for_changes
-    fi
     set -e
 fi
 
-- 
1.7.0.1


More information about the xorg-devel mailing list