11use crate :: {
2- branch_manager:: BranchManagerExt ,
32 commit:: { commit_to_vbranch_commit, VirtualBranchCommit } ,
43 conflicts:: { self , RepoConflictsExt } ,
54 file:: VirtualBranchFile ,
@@ -224,33 +223,6 @@ fn find_base_tree<'a>(
224223 Ok ( base_tree)
225224}
226225
227- /// Resolves the "old_applied" state of branches
228- ///
229- /// This should only ever be called by `list_virtual_branches
230- ///
231- /// This checks for the case where !branch.old_applied && branch.in_workspace
232- /// If this is the case, we ought to unapply the branch as it has been carried
233- /// over from the old style of unapplying
234- fn fixup_old_applied_state (
235- ctx : & CommandContext ,
236- vb_state : & VirtualBranchesHandle ,
237- perm : & mut WorktreeWritePermission ,
238- ) -> Result < ( ) > {
239- let branches = vb_state. list_all_branches ( ) ?;
240-
241- let branch_manager = ctx. branch_manager ( ) ;
242-
243- for mut branch in branches {
244- if branch. is_old_unapplied ( ) {
245- branch_manager. convert_to_real_branch ( branch. id , perm) ?;
246- } else if branch. applied != branch. in_workspace {
247- branch. applied = branch. in_workspace ;
248- vb_state. set_branch ( branch) ?;
249- }
250- }
251-
252- Ok ( ( ) )
253- }
254226pub fn list_virtual_branches (
255227 ctx : & CommandContext ,
256228 perm : & mut WorktreeWritePermission ,
@@ -275,8 +247,6 @@ pub fn list_virtual_branches_cached(
275247
276248 let vb_state = ctx. project ( ) . virtual_branches ( ) ;
277249
278- fixup_old_applied_state ( ctx, & vb_state, perm) ?;
279-
280250 let default_target = vb_state
281251 . get_default_target ( )
282252 . context ( "failed to get default target" ) ?;
0 commit comments