Skip to content

Commit b9b0be5

Browse files
authored
Merge pull request #65 from hotoo/feat/file-history
feat: cis -> commits, gitlab commit with branch
2 parents a10eee4 + ff70d20 commit b9b0be5

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

bin/gitopen

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ commander(process.argv, {
5050
}
5151
// 6. get openrc
5252
var config = getConfig(uri);
53+
command.type = config.type;
5354
command.scheme = config.scheme;
5455
command.protocol = config.protocol;
5556
// 6. resolve paths.

bin/open-commander.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,9 +242,11 @@ module.exports = function(argv, option, callback) {
242242
// options.hash = commander.args[2];
243243
// }
244244
// break;
245+
case 'cis':
245246
case 'commits':
246247
options.category = 'commits';
247248
if (commander.branch) {
249+
options.cwb = option.cwb;
248250
options.category = 'commits-with-branch';
249251
}
250252
break;

lib/index.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ module.exports = function(uri, options) {
145145
break;
146146
case 'commits':
147147
path = scheme.commits;
148+
if (options.type === 'gitlab') {
149+
path = scheme['commits-with-branch']
150+
.replace('{branch-name}', gitremote.encodeBranchName(options.cwb || options.hash));
151+
}
148152
break;
149153
case 'commits-with-branch':
150154
path = scheme['commits-with-branch']

0 commit comments

Comments
 (0)