Skip to content

Commit 2d04c59

Browse files
authored
Merge pull request #66 from hotoo/fix/branch-replace-double-hash
fix: replace multiple {hash}.
2 parents b9b0be5 + baa2187 commit 2d04c59

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

lib/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,11 @@ module.exports = function(uri, options) {
164164
path = scheme['branches'];
165165
break;
166166
case 'tree':
167-
path = scheme.tree.replace('{hash}', options.hash)
167+
path = scheme.tree.replace(/\{hash\}/g, options.hash)
168168
.replace('{path}', options.args.path);
169169
break;
170170
case 'blob':
171-
path = scheme.blob.replace('{hash}', options.hash)
171+
path = scheme.blob.replace(/\{hash\}/g, options.hash)
172172
.replace('{path}', options.args.path);
173173
break;
174174
case 'home':

lib/scheme/bitbucket.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ module.exports = {
99
'wiki': '/wiki',
1010
'network': '/network',
1111
'tree': '/src/{hash}{path}?at={hash}',
12-
'blob': '/src/{hash}{path}?at={hast}',
12+
'blob': '/src/{hash}{path}?at={hash}',
1313
'commit': '/commits/{hash}',
1414
'commits': '/commits',
1515
'commits-with-branch': '/commits/{branch-name}',

0 commit comments

Comments
 (0)