@@ -481,6 +481,9 @@ export const underlineLinksDefault = true
481481export const showDiffCheckMarksDefault = true
482482export const showDiffCheckMarksKey = 'diff-check-marks-visible'
483483
484+ export const showBranchNameInRepoListDefault = false
485+ export const showBranchNameInRepoListKey = 'show-branch-name-in-repo-list'
486+
484487const commitMessageGenerationDisclaimerLastSeenKey =
485488 'commit-message-generation-disclaimer-last-seen'
486489
@@ -646,6 +649,8 @@ export class AppStore extends TypedBaseStore<IAppState> {
646649
647650 private showDiffCheckMarks : boolean = showDiffCheckMarksDefault
648651
652+ private showBranchNameInRepoList : boolean = showBranchNameInRepoListDefault
653+
649654 private cachedRepoRulesets = new Map < number , IAPIRepoRuleset > ( )
650655
651656 private underlineLinks : boolean = underlineLinksDefault
@@ -1193,6 +1198,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
11931198 cachedRepoRulesets : this . cachedRepoRulesets ,
11941199 underlineLinks : this . underlineLinks ,
11951200 showDiffCheckMarks : this . showDiffCheckMarks ,
1201+ showBranchNameInRepoList : this . showBranchNameInRepoList ,
11961202 updateState : updateStore . state ,
11971203 commitMessageGenerationDisclaimerLastSeen :
11981204 this . commitMessageGenerationDisclaimerLastSeen ,
@@ -2596,6 +2602,11 @@ export class AppStore extends TypedBaseStore<IAppState> {
25962602 showDiffCheckMarksDefault
25972603 )
25982604
2605+ this . showBranchNameInRepoList = getBoolean (
2606+ showBranchNameInRepoListKey ,
2607+ showBranchNameInRepoListDefault
2608+ )
2609+
25992610 this . commitMessageGenerationDisclaimerLastSeen =
26002611 getNumber ( commitMessageGenerationDisclaimerLastSeenKey ) ?? null
26012612
@@ -3991,6 +4002,7 @@ export class AppStore extends TypedBaseStore<IAppState> {
39914002 lookup . set ( repository . id , {
39924003 aheadBehind : status . branchAheadBehind || null ,
39934004 changedFilesCount : status . workingDirectory . files . length ,
4005+ branchName : status . currentBranch ,
39944006 } )
39954007 }
39964008 /**
@@ -4032,9 +4044,11 @@ export class AppStore extends TypedBaseStore<IAppState> {
40324044 const existing = lookup . get ( repository . id )
40334045 lookup . set ( repository . id , {
40344046 aheadBehind : aheadBehind ,
4035- // We don't need to update changedFilesCount here since it was already
4036- // set when calling `updateSidebarIndicator()` with the status object.
4047+ // We don't need to update changedFilesCount or branchName here since
4048+ // they were already set when calling `updateSidebarIndicator()` with
4049+ // the status object.
40374050 changedFilesCount : existing ?. changedFilesCount ?? 0 ,
4051+ branchName : existing ?. branchName ,
40384052 } )
40394053 this . emitUpdate ( )
40404054 }
@@ -9120,6 +9134,14 @@ export class AppStore extends TypedBaseStore<IAppState> {
91209134 }
91219135 }
91229136
9137+ public _updateShowBranchNameInRepoList ( showBranchNameInRepoList : boolean ) {
9138+ if ( showBranchNameInRepoList !== this . showBranchNameInRepoList ) {
9139+ this . showBranchNameInRepoList = showBranchNameInRepoList
9140+ setBoolean ( showBranchNameInRepoListKey , showBranchNameInRepoList )
9141+ this . emitUpdate ( )
9142+ }
9143+ }
9144+
91239145 public _updateFileListFilter (
91249146 repository : Repository ,
91259147 filterUpdate : Partial < IFileListFilterState >
0 commit comments