Skip to content

Commit

Permalink
Ensure we're picking up the custom system config
Browse files Browse the repository at this point in the history
  • Loading branch information
niik committed May 23, 2024
1 parent c11a811 commit 6cfdf3c
Showing 1 changed file with 28 additions and 1 deletion.
29 changes: 28 additions & 1 deletion test/fast/config-test.ts
Original file line number Diff line number Diff line change
@@ -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', () => {
Expand All @@ -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')
}
})
})

0 comments on commit 6cfdf3c

Please sign in to comment.