@@ -27,7 +27,6 @@ export function Header({
2727 isCurrentlyCheckedOut,
2828 isDraft,
2929 isIssue,
30- repositoryDefaultBranch,
3130 doneCheckoutBranch,
3231 events,
3332 owner,
@@ -58,7 +57,6 @@ export function Header({
5857 < ButtonGroup
5958 isCurrentlyCheckedOut = { isCurrentlyCheckedOut }
6059 isIssue = { isIssue }
61- repositoryDefaultBranch = { repositoryDefaultBranch }
6260 doneCheckoutBranch = { doneCheckoutBranch }
6361 owner = { owner }
6462 repo = { repo }
@@ -148,20 +146,19 @@ function Title({ title, titleHTML, number, url, inEditMode, setEditMode, setCurr
148146interface ButtonGroupProps {
149147 isCurrentlyCheckedOut : boolean ;
150148 isIssue : boolean ;
151- repositoryDefaultBranch : string ;
152149 doneCheckoutBranch : string ;
153150 owner : string ;
154151 repo : string ;
155152 number : number ;
156153 busy ?: boolean ;
157154}
158155
159- function ButtonGroup ( { isCurrentlyCheckedOut, isIssue, repositoryDefaultBranch , doneCheckoutBranch, owner, repo, number, busy } : ButtonGroupProps ) : JSX . Element {
156+ function ButtonGroup ( { isCurrentlyCheckedOut, isIssue, doneCheckoutBranch, owner, repo, number, busy } : ButtonGroupProps ) : JSX . Element {
160157 const { refresh } = useContext ( PullRequestContext ) ;
161158
162159 return (
163160 < div className = "button-group" >
164- < CheckoutButton { ...{ isCurrentlyCheckedOut, isIssue, repositoryDefaultBranch , doneCheckoutBranch, owner, repo, number } } />
161+ < CheckoutButton { ...{ isCurrentlyCheckedOut, isIssue, doneCheckoutBranch, owner, repo, number } } />
165162 < button title = "Refresh with the latest data from GitHub" onClick = { refresh } className = "secondary" >
166163 Refresh
167164 </ button >
@@ -287,14 +284,13 @@ function Subtitle({ state, stateReason, isDraft, isIssue, author, base, head, co
287284interface CheckoutButtonProps {
288285 isCurrentlyCheckedOut : boolean ;
289286 isIssue : boolean ;
290- repositoryDefaultBranch : string ;
291287 doneCheckoutBranch : string ;
292288 owner : string ;
293289 repo : string ;
294290 number : number ;
295291}
296292
297- const CheckoutButton : React . FC < CheckoutButtonProps > = ( { isCurrentlyCheckedOut, isIssue, repositoryDefaultBranch , doneCheckoutBranch, owner, repo, number } ) => {
293+ const CheckoutButton : React . FC < CheckoutButtonProps > = ( { isCurrentlyCheckedOut, isIssue, doneCheckoutBranch, owner, repo, number } ) => {
298294 const { exitReviewMode, checkout, openChanges } = useContext ( PullRequestContext ) ;
299295 const [ isBusy , setBusy ] = useState ( false ) ;
300296
@@ -335,13 +331,8 @@ const CheckoutButton: React.FC<CheckoutButtonProps> = ({ isCurrentlyCheckedOut,
335331 const actions : { label : string ; value : string ; action : ( event : React . MouseEvent < HTMLButtonElement , MouseEvent > ) => void } [ ] = [ ] ;
336332
337333 if ( isCurrentlyCheckedOut ) {
338- // Use doneCheckoutBranch which has the appropriate branch name already computed
339- const buttonLabel = doneCheckoutBranch === repositoryDefaultBranch
340- ? `Checkout '${ repositoryDefaultBranch } '`
341- : `Checkout target branch '${ doneCheckoutBranch } '` ;
342-
343- actions . push ( {
344- label : buttonLabel ,
334+ actions . push ( {
335+ label : `Checkout '${ doneCheckoutBranch } '` ,
345336 value : '' ,
346337 action : ( ) => onClick ( 'exitReviewMode' )
347338 } ) ;
0 commit comments