From d7e079fd3776909952617acbebbc842073410eab Mon Sep 17 00:00:00 2001 From: Sergio Padrino Date: Thu, 14 Jul 2022 09:26:20 +0200 Subject: [PATCH] Add test for unsafe repo detection --- app/test/unit/git/rev-parse-test.ts | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/app/test/unit/git/rev-parse-test.ts b/app/test/unit/git/rev-parse-test.ts index 6e99e01e7c..aef3d33743 100644 --- a/app/test/unit/git/rev-parse-test.ts +++ b/app/test/unit/git/rev-parse-test.ts @@ -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 + }) }) })