From ff494eb9b631a9b24901d1983eccaa5c08e4c7bf Mon Sep 17 00:00:00 2001
From: Emmanuel Raviart <emmanuel@raviart.com>
Date: Mon, 31 Mar 2025 17:51:40 +0200
Subject: [PATCH] Don't fail when there is no branch

---
 packages/tools/src/scripts/gitlab-ci.ts | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/packages/tools/src/scripts/gitlab-ci.ts b/packages/tools/src/scripts/gitlab-ci.ts
index 3669552..a24a86c 100644
--- a/packages/tools/src/scripts/gitlab-ci.ts
+++ b/packages/tools/src/scripts/gitlab-ci.ts
@@ -341,9 +341,11 @@ async function extractOpenFiscaJson() {
       ? `git@${CI_SERVER_HOST}:leximpact/simulateur-socio-fiscal/leximpact-socio-fiscal-openfisca-json.git`
       : `https://${CI_SERVER_HOST}/leximpact/simulateur-socio-fiscal/leximpact-socio-fiscal-openfisca-json.git`
   cd(rootDir)
-  await $`git clone ${
-    JSON_BRANCH?.trim() ? ["--branch", JSON_BRANCH] : ""
-  } ${repository} ${jsonDir}`
+  if (JSON_BRANCH?.trim()) {
+    await $`git clone --branch ${JSON_BRANCH} ${repository} ${jsonDir}`
+  } else {
+    await $`git clone ${repository} ${jsonDir}`
+  }
   cd(toolsDir)
 
   // Extract JSON from OpenFisca source code.
-- 
GitLab