@@ -232,9 +232,9 @@ fn find_base_tree<'a>(
232232/// This should only ever be called by `list_virtual_branches 
233233/// 
234234/// This checks for the case where !branch.old_applied && branch.in_workspace 
235- /// If this is the case, we ought to unapply the branch as its  been carried 
235+ /// If this is the case, we ought to unapply the branch as it has  been carried 
236236/// over from the old style of unapplying 
237- fn  resolve_old_applied_state ( 
237+ fn  fixup_old_applied_state ( 
238238    ctx :  & CommandContext , 
239239    vb_state :  & VirtualBranchesHandle , 
240240    perm :  & mut  WorktreeWritePermission , 
@@ -278,7 +278,7 @@ pub fn list_virtual_branches_cached(
278278
279279    let  vb_state = ctx. project ( ) . virtual_branches ( ) ; 
280280
281-     resolve_old_applied_state ( ctx,  & vb_state,  perm) ?; 
281+     fixup_old_applied_state ( ctx,  & vb_state,  perm) ?; 
282282
283283    let  default_target = vb_state
284284        . get_default_target ( ) 
@@ -292,6 +292,8 @@ pub fn list_virtual_branches_cached(
292292        . max ( ) 
293293        . unwrap_or ( -1 ) ; 
294294
295+     let  branches_span =
296+         tracing:: debug_span!( "handle branches" ,  num_branches = status. branches. len( ) ) . entered ( ) ; 
295297    for  ( branch,  mut  files)  in  status. branches  { 
296298        let  repo = ctx. repository ( ) ; 
297299        update_conflict_markers ( ctx,  files. clone ( ) ) ?; 
@@ -331,23 +333,31 @@ pub fn list_virtual_branches_cached(
331333        // find all commits on head that are not on target.sha 
332334        let  commits = ctx. log ( branch. head ,  LogUntil :: Commit ( default_target. sha ) ) ?; 
333335        let  check_commit = IsCommitIntegrated :: new ( ctx,  & default_target) ?; 
334-         let  vbranch_commits = commits
335-             . iter ( ) 
336-             . map ( |commit| { 
337-                 is_remote = if  is_remote { 
338-                     is_remote
339-                 }  else  { 
340-                     pushed_commits. contains_key ( & commit. id ( ) ) 
341-                 } ; 
342- 
343-                 // only check for integration if we haven't already found an integration 
344-                 if  !is_integrated { 
345-                     is_integrated = check_commit. is_integrated ( commit) ?
346-                 } ; 
347- 
348-                 commit_to_vbranch_commit ( ctx,  & branch,  commit,  is_integrated,  is_remote) 
349-             } ) 
350-             . collect :: < Result < Vec < _ > > > ( ) ?; 
336+         let  vbranch_commits = { 
337+             let  _span = tracing:: debug_span!( 
338+                 "is-commit-integrated" , 
339+                 given_name = branch. name, 
340+                 commits_to_check = commits. len( ) 
341+             ) 
342+             . entered ( ) ; 
343+             commits
344+                 . iter ( ) 
345+                 . map ( |commit| { 
346+                     is_remote = if  is_remote { 
347+                         is_remote
348+                     }  else  { 
349+                         pushed_commits. contains_key ( & commit. id ( ) ) 
350+                     } ; 
351+ 
352+                     // only check for integration if we haven't already found an integration 
353+                     if  !is_integrated { 
354+                         is_integrated = check_commit. is_integrated ( commit) ?
355+                     } ; 
356+ 
357+                     commit_to_vbranch_commit ( ctx,  & branch,  commit,  is_integrated,  is_remote) 
358+                 } ) 
359+                 . collect :: < Result < Vec < _ > > > ( ) ?
360+         } ; 
351361
352362        let  merge_base = repo
353363            . merge_base ( default_target. sha ,  branch. head ) 
@@ -409,6 +419,7 @@ pub fn list_virtual_branches_cached(
409419        } ; 
410420        branches. push ( branch) ; 
411421    } 
422+     drop ( branches_span) ; 
412423
413424    let  mut  branches = branches_with_large_files_abridged ( branches) ; 
414425    branches. sort_by ( |a,  b| a. order . cmp ( & b. order ) ) ; 
0 commit comments