Skip to content

Commit

Permalink
fix: only strip optional '.git' suffix from https server remote name …
Browse files Browse the repository at this point in the history
…and not 'Xgit' (peter-evans#1257)
  • Loading branch information
campersau authored and aleksandrychev committed Mar 4, 2024
1 parent b5840e6 commit 232667d
Show file tree
Hide file tree
Showing 3 changed files with 1,319 additions and 1,301 deletions.
18 changes: 18 additions & 0 deletions __test__/utils.unit.test.ts
Expand Up @@ -56,6 +56,24 @@ describe('utils tests', () => {
)
expect(remote4.protocol).toEqual('HTTPS')
expect(remote4.repository).toEqual('peter-evans/create-pull-request')

const remote5 = utils.getRemoteDetail(
'https://github.com/peter-evans/ungit'
)
expect(remote5.protocol).toEqual('HTTPS')
expect(remote5.repository).toEqual('peter-evans/ungit')

const remote6 = utils.getRemoteDetail(
'https://github.com/peter-evans/ungit.git'
)
expect(remote6.protocol).toEqual('HTTPS')
expect(remote6.repository).toEqual('peter-evans/ungit')

const remote7 = utils.getRemoteDetail(
'git@github.com:peter-evans/ungit.git'
)
expect(remote7.protocol).toEqual('SSH')
expect(remote7.repository).toEqual('peter-evans/ungit')
})

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

0 comments on commit 232667d

Please sign in to comment.