Skip to content

Commit 86bd5ba

Browse files
committed
branch command now properly handles unknown flags
1 parent 96e6f28 commit 86bd5ba

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

js/controlbox.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,19 +163,31 @@ define(['d3'], function () {
163163

164164
switch (arg) {
165165
case '--remote':
166+
case '-r':
166167
this.info(
167168
'This command normally displays all of your remote tracking branches.'
168169
);
169170
args.length = 0;
170171
break;
172+
case '--all':
173+
case '-a':
174+
this.info(
175+
'This command normally displays all of your tracking branches, both remote and local.'
176+
);
177+
break;
178+
case '--delete':
171179
case '-d':
172180
var name = args.pop();
173181
this.historyView.deleteBranch(name);
174182
break;
175183
default:
176-
var remainingArgs = [arg].concat(args);
177-
args.length = 0;
178-
this.historyView.branch(remainingArgs.join(' '));
184+
if (arg.charAt(0) == '-') {
185+
this.error();
186+
} else {
187+
var remainingArgs = [arg].concat(args);
188+
args.length = 0;
189+
this.historyView.branch(remainingArgs.join(' '));
190+
}
179191
}
180192
}
181193
},

0 commit comments

Comments
 (0)