mirror of
https://github.com/desktop/desktop
synced 2024-09-13 21:31:32 +00:00
Merge pull request #14971 from desktop/fix-unsafe-repos
Fix support for unsafe repositories
This commit is contained in:
commit
1b1f45071b
|
@ -37,7 +37,7 @@ export async function getRepositoryType(path: string): Promise<RepositoryType> {
|
|||
}
|
||||
|
||||
const unsafeMatch =
|
||||
/fatal: detected dubious ownership in repository at '(.+)\' /.exec(
|
||||
/fatal: detected dubious ownership in repository at '(.+)'/.exec(
|
||||
result.stderr
|
||||
)
|
||||
if (unsafeMatch) {
|
||||
|
|
|
@ -101,5 +101,13 @@ describe('git/rev-parse', () => {
|
|||
kind: 'missing',
|
||||
})
|
||||
})
|
||||
|
||||
it('returns unsafe for unsafe repository', async () => {
|
||||
process.env['GIT_TEST_ASSUME_DIFFERENT_OWNER'] = '1'
|
||||
expect(await getRepositoryType(repository.path)).toMatchObject({
|
||||
kind: 'unsafe',
|
||||
})
|
||||
process.env['GIT_TEST_ASSUME_DIFFERENT_OWNER'] = undefined
|
||||
})
|
||||
})
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue