fix: strip optional '.git' suffix from https server remote name. (#1153)

* Strip optional '.git' suffix from https server remote name.

* Revert "Strip optional '.git' suffix from https server remote name."

This reverts commit c2e9041213.

* Strip optional '.git' suffix from https server remote name.
This commit is contained in:
Scott Alexander 2022-03-31 01:10:39 -07:00 committed by GitHub
parent 0dfc93c104
commit 15b68d176d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 70 additions and 28 deletions

View file

@ -50,6 +50,12 @@ describe('utils tests', () => {
)
expect(remote3.protocol).toEqual('SSH')
expect(remote3.repository).toEqual('peter-evans/create-pull-request')
const remote4 = utils.getRemoteDetail(
'https://github.com/peter-evans/create-pull-request.git'
)
expect(remote4.protocol).toEqual('HTTPS')
expect(remote4.repository).toEqual('peter-evans/create-pull-request')
})
test('getRemoteDetail fails to parse a remote URL', async () => {