Skip to content

Commit ddab646

Browse files
authored
fix: only strip optional '.git' suffix from https server remote name and not 'Xgit' (#1257)
1 parent 3f9dbd5 commit ddab646

File tree

3 files changed

+1319
-1301
lines changed

3 files changed

+1319
-1301
lines changed

__test__/utils.unit.test.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,24 @@ describe('utils tests', () => {
5656
)
5757
expect(remote4.protocol).toEqual('HTTPS')
5858
expect(remote4.repository).toEqual('peter-evans/create-pull-request')
59+
60+
const remote5 = utils.getRemoteDetail(
61+
'https://github.com/peter-evans/ungit'
62+
)
63+
expect(remote5.protocol).toEqual('HTTPS')
64+
expect(remote5.repository).toEqual('peter-evans/ungit')
65+
66+
const remote6 = utils.getRemoteDetail(
67+
'https://github.com/peter-evans/ungit.git'
68+
)
69+
expect(remote6.protocol).toEqual('HTTPS')
70+
expect(remote6.repository).toEqual('peter-evans/ungit')
71+
72+
const remote7 = utils.getRemoteDetail(
73+
'git@github.com:peter-evans/ungit.git'
74+
)
75+
expect(remote7.protocol).toEqual('SSH')
76+
expect(remote7.repository).toEqual('peter-evans/ungit')
5977
})
6078

6179
test('getRemoteDetail fails to parse a remote URL', async () => {

0 commit comments

Comments
 (0)