[PATCH] Check for valid branch when building

Nelson Castillo arhuaco at freaks-unidos.net
Thu Feb 19 23:24:11 CET 2009


From: Nelson Castillo <arhuaco at freaks-unidos.net>

Make sure we are in a valid branch to avoid
OM developers some trouble.

* Print a nice message if we are not in a valid branch.

Please feel free to edit the error message if you think it is
not clear enough.

Signed-off-by: Nelson Castillo <arhuaco at freaks-unidos.net>
---

 build |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/build b/build
index 58e24c7..67b01ab 100755
--- a/build
+++ b/build
@@ -63,6 +63,13 @@ if [ -z "$PRODUCT" ] ; then
 	exit 1
 fi
 
+
+#
+# make sure we are in a valid branch
+#
+
+[[ `git-branch | head -1` =~ "* (no branch)" ]] && echo -e "\nThere is no branch in the local copy of the repository right now!\nHint: type git-branch, make sure you are in a valid branch and then try again" && exit 1
+
 #
 # get the branch and head hash for the version we are building to
 # allow source tracability




More information about the openmoko-kernel mailing list