summary refs log tree commit diff stats
path: root/ci
diff options
context:
space:
mode:
Diffstat (limited to 'ci')
-rw-r--r--ci/build_autogen.bat2
-rw-r--r--ci/funs.sh8
2 files changed, 7 insertions, 3 deletions
diff --git a/ci/build_autogen.bat b/ci/build_autogen.bat
index 8b1113175..0b6ca566e 100644
--- a/ci/build_autogen.bat
+++ b/ci/build_autogen.bat
@@ -10,7 +10,7 @@ SET nim_csources=bin\nim_csources_%nim_csourcesHash%.exe
 echo "building from csources: %nim_csources%"
 
 if not exist %nim_csourcesDir% (
-  git clone -q --depth 1 %nim_csourcesUrl% %nim_csourcesDir%
+  git clone -q --depth 1 -b %nim_csourcesBranch% %nim_csourcesUrl% %nim_csourcesDir%
 )
 
 if not exist %nim_csources% (
diff --git a/ci/funs.sh b/ci/funs.sh
index 4a8887658..e25922c8c 100644
--- a/ci/funs.sh
+++ b/ci/funs.sh
@@ -120,8 +120,12 @@ nimBuildCsourcesIfNeeded(){
       else
         # Note: using git tags would allow fetching just what's needed, unlike git hashes, e.g.
         # via `git clone -q --depth 1 --branch $tag $nim_csourcesUrl`.
-        echo_run git clone -q --depth 1 $nim_csourcesUrl "$nim_csourcesDir"
-        echo_run git -C "$nim_csourcesDir" checkout $nim_csourcesHash
+        echo_run git clone -q --depth 1 -b $nim_csourcesBranch \
+            $nim_csourcesUrl "$nim_csourcesDir"
+        # old `git` versions don't support -C option, using `cd` explicitly:
+        echo_run cd "$nim_csourcesDir"
+        echo_run git checkout $nim_csourcesHash
+        echo_run cd "$OLDPWD"
         # if needed we could also add: `git reset --hard $nim_csourcesHash`
       fi
       _nimBuildCsourcesIfNeeded "$@"