aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvax Software <[email protected]>2011-04-08 10:45:38 +0200
committerEvax Software <[email protected]>2011-04-08 10:45:38 +0200
commit1d2fd523df44102a1b1ceb2310d921982b6d11c3 (patch)
treee70ce4565a1832cec029a89c09384155ac83daa1
parentf2b0266c608040a26109d587a007c8ece160041e (diff)
downloadkerl-1d2fd523df44102a1b1ceb2310d921982b6d11c3.tar.gz
kerl-1d2fd523df44102a1b1ceb2310d921982b6d11c3.tar.bz2
kerl-1d2fd523df44102a1b1ceb2310d921982b6d11c3.zip
Fix branch support in git builds
-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"