From 6cfdf3ce096555d796f3280c2a446198877c8c74 Mon Sep 17 00:00:00 2001 From: Markus Olsson Date: Thu, 23 May 2024 13:06:16 +0200 Subject: [PATCH] Ensure we're picking up the custom system config --- test/fast/config-test.ts | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/test/fast/config-test.ts b/test/fast/config-test.ts index af71dc01..c09836e5 100644 --- a/test/fast/config-test.ts +++ b/test/fast/config-test.ts @@ -1,4 +1,5 @@ -import { GitProcess } from '../../lib' +import { join, resolve } from 'path' +import { GitProcess, resolveGitDir } from '../../lib' import * as os from 'os' describe('config', () => { @@ -21,4 +22,30 @@ describe('config', () => { expect(result.stdout.trim()).toBe('') } }) + + it('turns on useHttpPath for Azure Devops', async () => { + const result = await GitProcess.exec( + ['config', '--system', 'credential.https://dev.azure.com.useHttpPath'], + os.homedir() + ) + expect(result.stdout.trim()).toBe('true') + }) + + it('uses the custom system config from dugite-native', async () => { + if (process.platform !== 'win32') { + const result = await GitProcess.exec( + ['config', '--show-origin', '--system', 'include.path'], + os.homedir() + ) + const [origin, value] = result.stdout.trim().split('\t') + + const originPath = origin.substring('file:'.length) + + expect(resolve(originPath)).toBe( + join(resolveGitDir(process.env), 'etc', 'gitconfig') + ) + + expect(value).toBe('/etc/gitconfig') + } + }) })