From 525aabeb4769fb34c639eccb2bfdf036067e49ae Mon Sep 17 00:00:00 2001 From: Sebastian Qvarfordt Date: Mon, 21 Sep 2020 15:33:53 +0200 Subject: [PATCH 1/2] Added toggled option for allowing longpath in windows through nodegit --- plugins/techdocs-backend/src/helpers.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/techdocs-backend/src/helpers.ts b/plugins/techdocs-backend/src/helpers.ts index 14f4d490ba..670c9f0970 100644 --- a/plugins/techdocs-backend/src/helpers.ts +++ b/plugins/techdocs-backend/src/helpers.ts @@ -17,7 +17,7 @@ import os from 'os'; import path from 'path'; import parseGitUrl from 'git-url-parse'; -import { Clone, Repository } from 'nodegit'; +import NodeGit, { Clone, Repository } from 'nodegit'; import fs from 'fs-extra'; // @ts-ignore import defaultBranch from 'default-branch'; @@ -26,6 +26,9 @@ import { InputError } from '@backstage/backend-common'; import { RemoteProtocol } from './techdocs/stages/prepare/types'; import { Logger } from 'winston'; +// @ts-ignore +NodeGit.Libgit2.opts(28, 1); + export type ParsedLocationAnnotation = { type: RemoteProtocol; target: string; From b80a8333239a02cd708123c44e39348537374d5c Mon Sep 17 00:00:00 2001 From: Sebastian Qvarfordt Date: Mon, 21 Sep 2020 16:51:46 +0200 Subject: [PATCH 2/2] comment to explain option --- plugins/techdocs-backend/src/helpers.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/techdocs-backend/src/helpers.ts b/plugins/techdocs-backend/src/helpers.ts index 670c9f0970..8acd836cad 100644 --- a/plugins/techdocs-backend/src/helpers.ts +++ b/plugins/techdocs-backend/src/helpers.ts @@ -26,6 +26,7 @@ import { InputError } from '@backstage/backend-common'; import { RemoteProtocol } from './techdocs/stages/prepare/types'; import { Logger } from 'winston'; +// Enables core.longpaths on windows to prevent crashing when checking out repos with long foldernames and/or deep nesting // @ts-ignore NodeGit.Libgit2.opts(28, 1);