From e7dd13cffa68898d9a19ae47660a17578d6bc827 Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Tue, 29 Nov 2022 15:10:34 +0100 Subject: [PATCH] fix: git checkout --- apps/api/src/lib/importers/github.ts | 4 ++-- apps/api/src/lib/importers/gitlab.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/apps/api/src/lib/importers/github.ts b/apps/api/src/lib/importers/github.ts index f310c4704..c57d804fe 100644 --- a/apps/api/src/lib/importers/github.ts +++ b/apps/api/src/lib/importers/github.ts @@ -38,7 +38,7 @@ export default async function ({ applicationId }); await asyncExecShell( - `git clone -q -b ${branch} https://${url}/${repository}.git ${workdir}/ && cd ${workdir} && git checkout ${gitCommitHash || "-"} && git submodule update --init --recursive && git lfs pull && cd .. ` + `git clone -q -b ${branch} https://${url}/${repository}.git ${workdir}/ && cd ${workdir} && git checkout ${gitCommitHash || ""} && git submodule update --init --recursive && git lfs pull && cd .. ` ); } else { @@ -69,7 +69,7 @@ export default async function ({ applicationId }); await asyncExecShell( - `git clone -q -b ${branch} https://x-access-token:${token}@${url}/${repository}.git --config core.sshCommand="ssh -p ${customPort}" ${workdir}/ && cd ${workdir} && git checkout ${gitCommitHash || "-"} && git submodule update --init --recursive && git lfs pull && cd .. ` + `git clone -q -b ${branch} https://x-access-token:${token}@${url}/${repository}.git --config core.sshCommand="ssh -p ${customPort}" ${workdir}/ && cd ${workdir} && git checkout ${gitCommitHash || ""} && git submodule update --init --recursive && git lfs pull && cd .. ` ); } const { stdout: commit } = await asyncExecShell(`cd ${workdir}/ && git rev-parse HEAD`); diff --git a/apps/api/src/lib/importers/gitlab.ts b/apps/api/src/lib/importers/gitlab.ts index 051e2a9d7..63808589a 100644 --- a/apps/api/src/lib/importers/gitlab.ts +++ b/apps/api/src/lib/importers/gitlab.ts @@ -42,11 +42,11 @@ export default async function ({ if (forPublic) { await asyncExecShell( - `git clone -q -b ${branch} https://${url}/${repository}.git ${workdir}/ && cd ${workdir}/ && git checkout ${gitCommitHash || "-"} && git submodule update --init --recursive && git lfs pull && cd .. ` + `git clone -q -b ${branch} https://${url}/${repository}.git ${workdir}/ && cd ${workdir}/ && git checkout ${gitCommitHash || ""} && git submodule update --init --recursive && git lfs pull && cd .. ` ); } else { await asyncExecShell( - `git clone -q -b ${branch} git@${url}:${repository}.git --config core.sshCommand="ssh -p ${customPort} -q -i ${repodir}id.rsa -o StrictHostKeyChecking=no" ${workdir}/ && cd ${workdir}/ && git checkout ${gitCommitHash || "-"} && git submodule update --init --recursive && git lfs pull && cd .. ` + `git clone -q -b ${branch} git@${url}:${repository}.git --config core.sshCommand="ssh -p ${customPort} -q -i ${repodir}id.rsa -o StrictHostKeyChecking=no" ${workdir}/ && cd ${workdir}/ && git checkout ${gitCommitHash || ""} && git submodule update --init --recursive && git lfs pull && cd .. ` ); }