Skip to content

Commit 61ca7fb

Browse files
committedOct 12, 2022
fix: parse branch names containing @
1 parent 3cd4a98 commit 61ca7fb

File tree

2 files changed

+63
-58
lines changed

2 files changed

+63
-58
lines changed
 

‎lib/index.js

+4-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function protocolToRepresentation (protocol) {
1717
}
1818

1919
function lastIndexOfBefore (str, char, beforeChar) {
20-
const startPosition = str.lastIndexOf(beforeChar)
20+
const startPosition = str.indexOf(beforeChar)
2121
return str.lastIndexOf(char, startPosition > -1 ? startPosition : Infinity)
2222
}
2323

@@ -193,7 +193,9 @@ const isGitHubShorthand = (arg) => {
193193

194194
// attempt to correct an scp style url so that it will parse with `new URL()`
195195
const correctUrl = (giturl) => {
196-
const firstAt = giturl.indexOf('@')
196+
// ignore @ that come after the first hash since the denotes the start
197+
// of a committish which can contain @ characters
198+
const firstAt = lastIndexOfBefore(giturl, '@', '#')
197199
// ignore colons that come after the hash since that could include colons such as:
198200
// git@github.com:user/package-2#semver:^1.0.0
199201
const lastColonBeforeHash = lastIndexOfBefore(giturl, ':', '#')

‎test/github.js

+59-56
Original file line numberDiff line numberDiff line change
@@ -26,158 +26,161 @@ const invalid = [
2626
// a subset of properties to a found object pass as you would expect
2727
const GitHost = require('../lib/git-host')
2828
const defaults = { constructor: GitHost, type: 'github', user: 'foo', project: 'bar' }
29+
// This is a valid git branch name that contains other occurences of the characters we check
30+
// for to determine the committish in order to test that we parse those correctly
31+
const committishDefaults = { committish: 'lk/br@nch.t#st:^1.0.0-pre.4' }
2932
const valid = {
3033
// extreme shorthand
3134
//
3235
// NOTE these do not accept auth at all
3336
'foo/bar': { ...defaults, default: 'shortcut' },
34-
'foo/bar#branch:^1.0.0': { ...defaults, default: 'shortcut', committish: 'branch:^1.0.0' },
37+
[`foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'shortcut', ...committishDefaults },
3538

3639
'foo/bar.git': { ...defaults, default: 'shortcut' },
37-
'foo/bar.git#branch:^1.0.0': { ...defaults, default: 'shortcut', committish: 'branch:^1.0.0' },
40+
[`foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'shortcut', ...committishDefaults },
3841

3942
// shortcuts
4043
//
4144
// NOTE auth is accepted but ignored
4245
'github:foo/bar': { ...defaults, default: 'shortcut' },
43-
'github:foo/bar#branch:^1.0.0': { ...defaults, default: 'shortcut', committish: 'branch:^1.0.0' },
46+
[`github:foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'shortcut', ...committishDefaults },
4447
'github:user@foo/bar': { ...defaults, default: 'shortcut', auth: null },
45-
'github:user@foo/bar#branch:^1.0.0': { ...defaults, default: 'shortcut', auth: null, committish: 'branch:^1.0.0' },
48+
[`github:user@foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'shortcut', auth: null, ...committishDefaults },
4649
'github:user:password@foo/bar': { ...defaults, default: 'shortcut', auth: null },
47-
'github:user:password@foo/bar#branch:^1.0.0': { ...defaults, default: 'shortcut', auth: null, committish: 'branch:^1.0.0' },
50+
[`github:user:password@foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'shortcut', auth: null, ...committishDefaults },
4851
'github::password@foo/bar': { ...defaults, default: 'shortcut', auth: null },
49-
'github::password@foo/bar#branch:^1.0.0': { ...defaults, default: 'shortcut', auth: null, committish: 'branch:^1.0.0' },
52+
[`github::password@foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'shortcut', auth: null, ...committishDefaults },
5053

5154
'github:foo/bar.git': { ...defaults, default: 'shortcut' },
52-
'github:foo/bar.git#branch:^1.0.0': { ...defaults, default: 'shortcut', committish: 'branch:^1.0.0' },
55+
[`github:foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'shortcut', ...committishDefaults },
5356
'github:user@foo/bar.git': { ...defaults, default: 'shortcut', auth: null },
54-
'github:user@foo/bar.git#branch:^1.0.0': { ...defaults, default: 'shortcut', auth: null, committish: 'branch:^1.0.0' },
57+
[`github:user@foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'shortcut', auth: null, ...committishDefaults },
5558
'github:user:password@foo/bar.git': { ...defaults, default: 'shortcut', auth: null },
56-
'github:user:password@foo/bar.git#branch:^1.0.0': { ...defaults, default: 'shortcut', auth: null, committish: 'branch:^1.0.0' },
59+
[`github:user:password@foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'shortcut', auth: null, ...committishDefaults },
5760
'github::password@foo/bar.git': { ...defaults, default: 'shortcut', auth: null },
58-
'github::password@foo/bar.git#branch:^1.0.0': { ...defaults, default: 'shortcut', auth: null, committish: 'branch:^1.0.0' },
61+
[`github::password@foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'shortcut', auth: null, ...committishDefaults },
5962

6063
// git urls
6164
//
6265
// NOTE auth is accepted and respected
6366
'git://github.com/foo/bar': { ...defaults, default: 'git' },
64-
'git://github.com/foo/bar#branch:^1.0.0': { ...defaults, default: 'git', committish: 'branch:^1.0.0' },
67+
[`git://github.com/foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'git', ...committishDefaults },
6568
'git://user@github.com/foo/bar': { ...defaults, default: 'git', auth: 'user' },
66-
'git://user@github.com/foo/bar#branch:^1.0.0': { ...defaults, default: 'git', auth: 'user', committish: 'branch:^1.0.0' },
69+
[`git://user@github.com/foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'git', auth: 'user', ...committishDefaults },
6770
'git://user:password@github.com/foo/bar': { ...defaults, default: 'git', auth: 'user:password' },
68-
'git://user:password@github.com/foo/bar#branch:^1.0.0': { ...defaults, default: 'git', auth: 'user:password', committish: 'branch:^1.0.0' },
71+
[`git://user:password@github.com/foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'git', auth: 'user:password', ...committishDefaults },
6972
'git://:password@github.com/foo/bar': { ...defaults, default: 'git', auth: ':password' },
70-
'git://:password@github.com/foo/bar#branch:^1.0.0': { ...defaults, default: 'git', auth: ':password', committish: 'branch:^1.0.0' },
73+
[`git://:password@github.com/foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'git', auth: ':password', ...committishDefaults },
7174

7275
'git://github.com/foo/bar.git': { ...defaults, default: 'git' },
73-
'git://github.com/foo/bar.git#branch:^1.0.0': { ...defaults, default: 'git', committish: 'branch:^1.0.0' },
76+
[`git://github.com/foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'git', ...committishDefaults },
7477
'git://git@github.com/foo/bar.git': { ...defaults, default: 'git', auth: 'git' },
75-
'git://git@github.com/foo/bar.git#branch:^1.0.0': { ...defaults, default: 'git', auth: 'git', committish: 'branch:^1.0.0' },
78+
[`git://git@github.com/foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'git', auth: 'git', ...committishDefaults },
7679
'git://user:password@github.com/foo/bar.git': { ...defaults, default: 'git', auth: 'user:password' },
77-
'git://user:password@github.com/foo/bar.git#branch:^1.0.0': { ...defaults, default: 'git', auth: 'user:password', committish: 'branch:^1.0.0' },
80+
[`git://user:password@github.com/foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'git', auth: 'user:password', ...committishDefaults },
7881
'git://:password@github.com/foo/bar.git': { ...defaults, default: 'git', auth: ':password' },
79-
'git://:password@github.com/foo/bar.git#branch:^1.0.0': { ...defaults, default: 'git', auth: ':password', committish: 'branch:^1.0.0' },
82+
[`git://:password@github.com/foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'git', auth: ':password', ...committishDefaults },
8083

8184
// no-protocol git+ssh
8285
//
8386
// NOTE auth is _required_ (see invalid list) but ignored
8487
'user@github.com:foo/bar': { ...defaults, default: 'sshurl', auth: null },
85-
'user@github.com:foo/bar#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
88+
[`user@github.com:foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
8689
'user:password@github.com:foo/bar': { ...defaults, default: 'sshurl', auth: null },
87-
'user:password@github.com:foo/bar#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
90+
[`user:password@github.com:foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
8891
':password@github.com:foo/bar': { ...defaults, default: 'sshurl', auth: null },
89-
':password@github.com:foo/bar#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
92+
[`:password@github.com:foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
9093

9194
'user@github.com:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
92-
'user@github.com:foo/bar.git#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
95+
[`user@github.com:foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
9396
'user:password@github.com:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
94-
'user:password@github.com:foo/bar.git#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
97+
[`user:password@github.com:foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
9598
':password@github.com:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
96-
':password@github.com:foo/bar.git#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
99+
[`:password@github.com:foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
97100

98101
// git+ssh urls
99102
//
100103
// NOTE auth is accepted but ignored
101104
'git+ssh://github.com:foo/bar': { ...defaults, default: 'sshurl' },
102-
'git+ssh://github.com:foo/bar#branch:^1.0.0': { ...defaults, default: 'sshurl', committish: 'branch:^1.0.0' },
105+
[`git+ssh://github.com:foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', ...committishDefaults },
103106
'git+ssh://user@github.com:foo/bar': { ...defaults, default: 'sshurl', auth: null },
104-
'git+ssh://user@github.com:foo/bar#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
107+
[`git+ssh://user@github.com:foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
105108
'git+ssh://user:password@github.com:foo/bar': { ...defaults, default: 'sshurl', auth: null },
106-
'git+ssh://user:password@github.com:foo/bar#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
109+
[`git+ssh://user:password@github.com:foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
107110
'git+ssh://:password@github.com:foo/bar': { ...defaults, default: 'sshurl', auth: null },
108-
'git+ssh://:password@github.com:foo/bar#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
111+
[`git+ssh://:password@github.com:foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
109112

110113
'git+ssh://github.com:foo/bar.git': { ...defaults, default: 'sshurl' },
111-
'git+ssh://github.com:foo/bar.git#branch:^1.0.0': { ...defaults, default: 'sshurl', committish: 'branch:^1.0.0' },
114+
[`git+ssh://github.com:foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', ...committishDefaults },
112115
'git+ssh://user@github.com:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
113-
'git+ssh://user@github.com:foo/bar.git#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
116+
[`git+ssh://user@github.com:foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
114117
'git+ssh://user:password@github.com:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
115-
'git+ssh://user:password@github.com:foo/bar.git#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
118+
[`git+ssh://user:password@github.com:foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
116119
'git+ssh://:password@github.com:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
117-
'git+ssh://:password@github.com:foo/bar.git#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
120+
[`git+ssh://:password@github.com:foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
118121

119122
// ssh urls
120123
//
121124
// NOTE auth is accepted but ignored
122125
'ssh://github.com:foo/bar': { ...defaults, default: 'sshurl' },
123-
'ssh://github.com:foo/bar#branch:^1.0.0': { ...defaults, default: 'sshurl', committish: 'branch:^1.0.0' },
126+
[`ssh://github.com:foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', ...committishDefaults },
124127
'ssh://user@github.com:foo/bar': { ...defaults, default: 'sshurl', auth: null },
125-
'ssh://user@github.com:foo/bar#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
128+
[`ssh://user@github.com:foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
126129
'ssh://user:password@github.com:foo/bar': { ...defaults, default: 'sshurl', auth: null },
127-
'ssh://user:password@github.com:foo/bar#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
130+
[`ssh://user:password@github.com:foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
128131
'ssh://:password@github.com:foo/bar': { ...defaults, default: 'sshurl', auth: null },
129-
'ssh://:password@github.com:foo/bar#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
132+
[`ssh://:password@github.com:foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
130133

131134
'ssh://github.com:foo/bar.git': { ...defaults, default: 'sshurl' },
132-
'ssh://github.com:foo/bar.git#branch:^1.0.0': { ...defaults, default: 'sshurl', committish: 'branch:^1.0.0' },
135+
[`ssh://github.com:foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', ...committishDefaults },
133136
'ssh://user@github.com:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
134-
'ssh://user@github.com:foo/bar.git#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
137+
[`ssh://user@github.com:foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
135138
'ssh://user:password@github.com:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
136-
'ssh://user:password@github.com:foo/bar.git#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
139+
[`ssh://user:password@github.com:foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
137140
'ssh://:password@github.com:foo/bar.git': { ...defaults, default: 'sshurl', auth: null },
138-
'ssh://:password@github.com:foo/bar.git#branch:^1.0.0': { ...defaults, default: 'sshurl', auth: null, committish: 'branch:^1.0.0' },
141+
[`ssh://:password@github.com:foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'sshurl', auth: null, ...committishDefaults },
139142

140143
// git+https urls
141144
//
142145
// NOTE auth is accepted and respected
143146
'git+https://github.com/foo/bar': { ...defaults, default: 'https' },
144-
'git+https://github.com/foo/bar#branch:^1.0.0': { ...defaults, default: 'https', committish: 'branch:^1.0.0' },
147+
[`git+https://github.com/foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'https', ...committishDefaults },
145148
'git+https://user@github.com/foo/bar': { ...defaults, default: 'https', auth: 'user' },
146-
'git+https://user@github.com/foo/bar#branch:^1.0.0': { ...defaults, default: 'https', auth: 'user', committish: 'branch:^1.0.0' },
149+
[`git+https://user@github.com/foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'https', auth: 'user', ...committishDefaults },
147150
'git+https://user:password@github.com/foo/bar': { ...defaults, default: 'https', auth: 'user:password' },
148-
'git+https://user:password@github.com/foo/bar#branch:^1.0.0': { ...defaults, default: 'https', auth: 'user:password', committish: 'branch:^1.0.0' },
151+
[`git+https://user:password@github.com/foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'https', auth: 'user:password', ...committishDefaults },
149152
'git+https://:password@github.com/foo/bar': { ...defaults, default: 'https', auth: ':password' },
150-
'git+https://:password@github.com/foo/bar#branch:^1.0.0': { ...defaults, default: 'https', auth: ':password', committish: 'branch:^1.0.0' },
153+
[`git+https://:password@github.com/foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'https', auth: ':password', ...committishDefaults },
151154

152155
'git+https://github.com/foo/bar.git': { ...defaults, default: 'https' },
153-
'git+https://github.com/foo/bar.git#branch:^1.0.0': { ...defaults, default: 'https', committish: 'branch:^1.0.0' },
156+
[`git+https://github.com/foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'https', ...committishDefaults },
154157
'git+https://user@github.com/foo/bar.git': { ...defaults, default: 'https', auth: 'user' },
155-
'git+https://user@github.com/foo/bar.git#branch:^1.0.0': { ...defaults, default: 'https', auth: 'user', committish: 'branch:^1.0.0' },
158+
[`git+https://user@github.com/foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'https', auth: 'user', ...committishDefaults },
156159
'git+https://user:password@github.com/foo/bar.git': { ...defaults, default: 'https', auth: 'user:password' },
157-
'git+https://user:password@github.com/foo/bar.git#branch:^1.0.0': { ...defaults, default: 'https', auth: 'user:password', committish: 'branch:^1.0.0' },
160+
[`git+https://user:password@github.com/foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'https', auth: 'user:password', ...committishDefaults },
158161
'git+https://:password@github.com/foo/bar.git': { ...defaults, default: 'https', auth: ':password' },
159-
'git+https://:password@github.com/foo/bar.git#branch:^1.0.0': { ...defaults, default: 'https', auth: ':password', committish: 'branch:^1.0.0' },
162+
[`git+https://:password@github.com/foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'https', auth: ':password', ...committishDefaults },
160163

161164
// https urls
162165
//
163166
// NOTE auth is accepted and respected
164167
'https://github.com/foo/bar': { ...defaults, default: 'https' },
165-
'https://github.com/foo/bar#branch:^1.0.0': { ...defaults, default: 'https', committish: 'branch:^1.0.0' },
168+
[`https://github.com/foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'https', ...committishDefaults },
166169
'https://user@github.com/foo/bar': { ...defaults, default: 'https', auth: 'user' },
167-
'https://user@github.com/foo/bar#branch:^1.0.0': { ...defaults, default: 'https', auth: 'user', committish: 'branch:^1.0.0' },
170+
[`https://user@github.com/foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'https', auth: 'user', ...committishDefaults },
168171
'https://user:password@github.com/foo/bar': { ...defaults, default: 'https', auth: 'user:password' },
169-
'https://user:password@github.com/foo/bar#branch:^1.0.0': { ...defaults, default: 'https', auth: 'user:password', committish: 'branch:^1.0.0' },
172+
[`https://user:password@github.com/foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'https', auth: 'user:password', ...committishDefaults },
170173
'https://:password@github.com/foo/bar': { ...defaults, default: 'https', auth: ':password' },
171-
'https://:password@github.com/foo/bar#branch:^1.0.0': { ...defaults, default: 'https', auth: ':password', committish: 'branch:^1.0.0' },
174+
[`https://:password@github.com/foo/bar#${committishDefaults.committish}`]: { ...defaults, default: 'https', auth: ':password', ...committishDefaults },
172175

173176
'https://github.com/foo/bar.git': { ...defaults, default: 'https' },
174-
'https://github.com/foo/bar.git#branch:^1.0.0': { ...defaults, default: 'https', committish: 'branch:^1.0.0' },
177+
[`https://github.com/foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'https', ...committishDefaults },
175178
'https://user@github.com/foo/bar.git': { ...defaults, default: 'https', auth: 'user' },
176-
'https://user@github.com/foo/bar.git#branch:^1.0.0': { ...defaults, default: 'https', auth: 'user', committish: 'branch:^1.0.0' },
179+
[`https://user@github.com/foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'https', auth: 'user', ...committishDefaults },
177180
'https://user:password@github.com/foo/bar.git': { ...defaults, default: 'https', auth: 'user:password' },
178-
'https://user:password@github.com/foo/bar.git#branch:^1.0.0': { ...defaults, default: 'https', auth: 'user:password', committish: 'branch:^1.0.0' },
181+
[`https://user:password@github.com/foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'https', auth: 'user:password', ...committishDefaults },
179182
'https://:password@github.com/foo/bar.git': { ...defaults, default: 'https', auth: ':password' },
180-
'https://:password@github.com/foo/bar.git#branch:^1.0.0': { ...defaults, default: 'https', auth: ':password', committish: 'branch:^1.0.0' },
183+
[`https://:password@github.com/foo/bar.git#${committishDefaults.committish}`]: { ...defaults, default: 'https', auth: ':password', ...committishDefaults },
181184

182185
// inputs that are not quite proper but we accept anyway
183186
'https://www.github.com/foo/bar': { ...defaults, default: 'https' },

0 commit comments

Comments
 (0)
Please sign in to comment.