Skip to content

Commit 696bea5

Browse files
authored
chore: explicit sha-1 and sha-256 git committish tests (#233)
1 parent 6dc0aef commit 696bea5

3 files changed

Lines changed: 7 additions & 6 deletions

File tree

test/clone.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ const refs = [
166166
]
167167

168168
const npa = require('npm-package-arg')
169-
const hashre = /^[a-f0-9]{40}$/
169+
const hashre = /^[a-f0-9]{40,64}$/
170170

171171
t.test('check every out', t => {
172172
t.jobs = 2

test/lines-to-revs.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ const first = [
1717

1818
const second = [
1919
'90add9eed16ee6bff5869c006b7245946d881fea\tHEAD',
20-
'd249e847bfb67c5bc436447a323731ff70d2a7e5\trefs/heads/latest',
20+
// sha-256 rev
21+
'8e3a9b3579ab330238c06b761e7f1b5dc5b4ac6e5a96da4dd2fb3b7411009df8\trefs/heads/latest',
2122
'90add9eed16ee6bff5869c006b7245946d881fea\trefs/heads/master',
2223
'1111111111111111111111111111111111111111\trefs/pull/1/head',
2324
'2222222222222222222222222222222222222222\trefs/pull/1/merge',
@@ -26,20 +27,20 @@ const second = [
2627
'fc6d0a2c3aaccf4cba5aebe38c963b934942b34f\trefs/tags/69.42.0',
2728
'90add9eed16ee6bff5869c006b7245946d881fea\trefs/tags/69.42.0^{}',
2829
'b9ad1935ceee7c9bdfc4851743fd7994cf6838a6\trefs/tags/699007199254740992.0.0',
29-
'd249e847bfb67c5bc436447a323731ff70d2a7e5\trefs/tags/699007199254740992.0.0^{}',
30+
'8e3a9b3579ab330238c06b761e7f1b5dc5b4ac6e5a96da4dd2fb3b7411009df8\trefs/tags/699007199254740992.0.0^{}',
3031
'4f0de9d26f02f67d77227bf4fcf10ec1549756b0\trefs/tags/asdf',
3132
'0000000000000000000000000000000000000000\t',
3233
'fc13b8fcdb7b036bdcdf76c8926033e2f1592362\trefs/tags/asdf^{}',
3334
'6a8378f1a56a1bb73e6f505194b2611b657efc69\trefs/tags/quux',
3435
'8c04f438e8f34620f056c7ef4f667ae4b14e55d4\trefs/tags/quux^{}',
3536
'574ed18efe056281a48bb97d4994d6ca2a00b9fb\trefs/tags/version-1.2.3',
36-
'd249e847bfb67c5bc436447a323731ff70d2a7e5\trefs/tags/version-1.2.3^{}',
37+
'8e3a9b3579ab330238c06b761e7f1b5dc5b4ac6e5a96da4dd2fb3b7411009df8\trefs/tags/version-1.2.3^{}',
3738
]
3839

3940
const t = require('tap')
4041

4142
// sharing is caring
42-
const shaRE = /^[0-9a-f]{40}$/
43+
const shaRE = /^[0-9a-f]{40,64}$/
4344
const expect = {
4445
versions: {
4546
'1.2.3': {

test/revs.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ t.test('add a latest branch, point to 1.2.3 version', () =>
6464
)
6565

6666
// sharing is caring
67-
const shaRE = /^[0-9a-f]{40}$/
67+
const shaRE = /^[0-9a-f]{40,64}$/
6868
const expect = {
6969
versions: {
7070
'1.2.3': {

0 commit comments

Comments
 (0)