From 07c9a9474a111f8e8dcd1787734135dd52f19b29 Mon Sep 17 00:00:00 2001 From: Sebastian Qvarfordt Date: Wed, 2 Sep 2020 15:30:35 +0200 Subject: [PATCH] Get branchname from repo instance instead of location url (#2242) --- .../techdocs-backend/src/techdocs/stages/prepare/helpers.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/techdocs-backend/src/techdocs/stages/prepare/helpers.ts b/plugins/techdocs-backend/src/techdocs/stages/prepare/helpers.ts index b2f04bbbbf..27e746590a 100644 --- a/plugins/techdocs-backend/src/techdocs/stages/prepare/helpers.ts +++ b/plugins/techdocs-backend/src/techdocs/stages/prepare/helpers.ts @@ -79,9 +79,10 @@ export const checkoutGitRepository = async ( if (fs.existsSync(repositoryTmpPath)) { const repository = await Repository.open(repositoryTmpPath); + const currentBranchName = (await repository.getCurrentBranch()).shorthand(); await repository.mergeBranches( - parsedGitLocation.ref, - `origin/${parsedGitLocation.ref}`, + currentBranchName, + `origin/${currentBranchName}`, ); return repositoryTmpPath; }