From 4c90f0b0c3151c63b82b2edf4411995feb7171ab Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 29 Jul 2009 10:50:10 +1000 Subject: [PATCH] release.sh: abort if local changes are detected. If 'git diff' or 'git status' detect local changes, abort. This check can be skipped with the --ignore-local-changes option. Signed-off-by: Peter Hutterer --- release.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/release.sh b/release.sh index 9f7358d..71efa72 100755 --- a/release.sh +++ b/release.sh @@ -19,9 +19,19 @@ Options: --force force overwritting an existing release --user username on $host_people (default "`whoami`") --help this help message + --ignore-local-changes don't abort on uncommitted local changes HELP } +abort_for_changes() +{ + cat < /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 + tarball_dir="$(dirname $(find . -name config.status))" module="${tag_current%-*}" if [ "x$module" = "x$tag_current" ]; then -- 2.11.4.GIT