Skip to content

Commit afce05e

Browse files
committed
Support git branch --remote and --all flags
1 parent 9725cab commit afce05e

File tree

2 files changed

+13
-10
lines changed

2 files changed

+13
-10
lines changed

js/controlbox.js

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -407,20 +407,23 @@ function(_yargs, d3, demos) {
407407
return this.getRepoView().deleteBranch(options.delete);
408408
}
409409

410-
if (options.remote) {
411-
return this.info('This command normally displays all of your remote tracking branches.');
412-
}
413-
414-
if (options.all) {
415-
return this.info('This command normally displays all of your tracking branches, both remote and local.');
416-
}
417-
418410
if (options._[2]) {
419411
return this.error('Incorrect usage - supplied too many arguments')
420412
}
421413

422414
if (!branchName) {
423-
var branches = this.getRepoView().getBranchList().join('<br>')
415+
var branches
416+
if (options.remote) {
417+
branches = this.getRepoView().getBranchList().filter(function (b) {
418+
return b.indexOf('&nbsp; origin/') === 0
419+
}).join('<br>')
420+
} else if (options.all) {
421+
branches = this.getRepoView().getBranchList().join('<br>')
422+
} else {
423+
branches = this.getRepoView().getBranchList().filter(function(b) {
424+
return b.indexOf('&nbsp; origin/') !== 0
425+
}).join('<br>')
426+
}
424427
return this.info(branches)
425428
}
426429

js/explaingit.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ define(['historyview', 'controlbox', 'd3'], function(HistoryView, ControlBox, d3
2525
originView = new HistoryView({
2626
name: name + '-Origin',
2727
width: 300,
28-
height: 225,
28+
height: 400,
2929
commitRadius: 15,
3030
remoteName: 'origin',
3131
commitData: args.originData,

0 commit comments

Comments
 (0)