change in updateSubmodules script

Possibility to set branch and doPull.
updateSubmodule.sh [<branch/tag> <doPull>]

Examples:
"updateSubmodule.sh" - This will checkout master and do a pull operation on all submodules.
"updateSubmodules.sh Kepler_M6 false" - This will checkout the tag Kepler_M6 without a pull operation on all submodules where possible (where there is a tag with this name).
diff --git a/checkoutToBranch.sh b/checkoutToBranch.sh
new file mode 100755
index 0000000..9e10f77
--- /dev/null
+++ b/checkoutToBranch.sh
@@ -0,0 +1,11 @@
+git rm --cached -r . > /dev/null
+git reset --hard > /dev/null
+git show-branch $1
+if [ "$?" = "0" ]; then
+	git checkout $1
+else
+	git checkout master
+fi
+if $2; then
+	git pull
+fi
\ No newline at end of file
diff --git a/updateSubmodules.sh b/updateSubmodules.sh
index 101c197..6a205d6 100755
--- a/updateSubmodules.sh
+++ b/updateSubmodules.sh
@@ -1 +1,6 @@
-git submodule foreach "(git rm --cached -r . > /dev/null; git reset --hard > /dev/null; git checkout master; git pull)"
+#!/bin/sh
+ROOT_PATH=`pwd`
+BRANCH=$(expr "$1" \| "master")
+PULL=$(expr "$2" \| "true")
+
+git submodule foreach "('$ROOT_PATH/checkoutToBranch.sh' $BRANCH $PULL)"
\ No newline at end of file