@@ -35,13 +35,6 @@ import {
35
35
} from '../style/NewBranchDialog' ;
36
36
import { Git , IGitExtension , Level } from '../tokens' ;
37
37
38
- const BRANCH_DESC = {
39
- current :
40
- 'The current branch. Pick this if you want to build on work done in this branch.' ,
41
- default :
42
- 'The default branch. Pick this if you want to start fresh from the default branch.'
43
- } ;
44
-
45
38
const ITEM_HEIGHT = 27.5 ; // HTML element height for a single branch
46
39
const CURRENT_BRANCH_HEIGHT = 66.5 ; // HTML element height for the current branch with description
47
40
const HEIGHT = 200 ; // HTML element height for the branches list
@@ -245,7 +238,9 @@ export class NewBranchDialog extends React.Component<
245
238
itemKey = { ( index , data ) => data [ index ] . name }
246
239
itemSize = { index => {
247
240
const branch = branches [ index ] ;
248
- return branch . name === this . props . currentBranch
241
+ return [ this . props . currentBranch , 'master' , 'main' ] . includes (
242
+ branch . name
243
+ )
249
244
? CURRENT_BRANCH_HEIGHT
250
245
: ITEM_HEIGHT ;
251
246
} }
@@ -295,25 +290,31 @@ export class NewBranchDialog extends React.Component<
295
290
const { data, index, style } = props ;
296
291
const branch = data [ index ] as Git . IBranch ;
297
292
293
+ const isBase = branch . name === this . state . base ;
298
294
const isCurrent = branch . name === this . props . currentBranch ;
299
295
300
296
let isBold ;
301
297
let desc ;
302
298
if ( isCurrent ) {
303
299
isBold = true ;
304
- desc = BRANCH_DESC [ 'current' ] ;
300
+ desc = this . props . trans . __ (
301
+ 'The current branch. Pick this if you want to build on work done in this branch.'
302
+ ) ;
303
+ } else if ( [ 'master' , 'main' ] . includes ( branch . name ) ) {
304
+ isBold = true ;
305
+ desc = this . props . trans . __ (
306
+ 'The default branch. Pick this if you want to start fresh from the default branch.'
307
+ ) ;
305
308
}
309
+
306
310
return (
307
311
< ListItem
308
312
button
309
313
title = { this . props . trans . __ (
310
314
'Create a new branch based on: %1' ,
311
315
branch . name
312
316
) }
313
- className = { classes (
314
- listItemClass ,
315
- isCurrent ? activeListItemClass : null
316
- ) }
317
+ className = { classes ( listItemClass , isBase ? activeListItemClass : null ) }
317
318
onClick = { this . _onBranchClickFactory ( branch . name ) }
318
319
style = { style }
319
320
>
0 commit comments