aboutsummaryrefslogtreecommitdiffstats
path: root/kerl
diff options
context:
space:
mode:
Diffstat (limited to 'kerl')
-rwxr-xr-xkerl7
1 files changed, 6 insertions, 1 deletions
diff --git a/kerl b/kerl
index 6be860d..e50dcc5 100755
--- a/kerl
+++ b/kerl
@@ -219,7 +219,12 @@ do_git_build()
exit 1
fi
cd otp_src_git
- git checkout $2 > /dev/null 2>&1
+ git branch -a | grep "$2" > /dev/null 2>&1
+ if [ "$?" -eq 1 ]; then
+ git checkout $2 > /dev/null 2>&1
+ else
+ git checkout -b $2 origin/$2 > /dev/null 2>&1
+ fi
if [ "$?" -eq 1 ]; then
echo "Couldn't checkout specified version"
rm -Rf "$KERL_BUILD_DIR/$3"