File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -537,14 +537,16 @@ export class RepoUtils{
537
537
538
538
static syncBranchHistory ( ) {
539
539
const brList = RepoUtils . repositoryDetails . branchList ;
540
- const savedBrList = Data . annotations . filter ( _ => _ . type === EnumAnnotationType . Branch ) . map ( _ => _ . value ) ;
541
- const newBrList = brList . filter ( _ => ! savedBrList . includes ( _ ) ) ;
540
+ const repoId = RepoUtils . repositoryDetails . repoInfo . _id ;
541
+ const savedBrList = Data . annotations . filter ( _ => _ . repoId === repoId && _ . type === EnumAnnotationType . Branch ) ;
542
+ const savedBrNameList = savedBrList . map ( _ => _ . value ) ;
543
+ const newBrList = brList . filter ( _ => ! savedBrNameList . includes ( _ ) ) ;
542
544
if ( newBrList . length ) {
543
545
const newAnnots :Annotation [ ] = [ ] ;
544
546
const date = new Date ( ) . toISOString ( ) ;
545
547
for ( let br of newBrList ) {
546
548
const newAnnot = createAnnotation ( {
547
- repoId : RepoUtils . repositoryDetails . repoInfo . _id ,
549
+ repoId,
548
550
type : EnumAnnotationType . Branch ,
549
551
value :br
550
552
} ) ;
@@ -555,7 +557,7 @@ export class RepoUtils{
555
557
IpcUtils . addAnnotation ( newAnnots ) ;
556
558
557
559
}
558
- const deletedBranches = Data . annotations . filter ( _ => ! brList . includes ( _ . value ) ) ;
560
+ const deletedBranches = savedBrList . filter ( _ => ! brList . includes ( _ . value ) ) ;
559
561
if ( deletedBranches . length ) {
560
562
IpcUtils . deleteAnnotations ( deletedBranches ) ;
561
563
}
You can’t perform that action at this time.
0 commit comments