@@ -1357,6 +1357,72 @@ fn workspace_obeys_limit_when_target_branch_is_missing() -> anyhow::Result<()> {
13571357    Ok ( ( ) ) 
13581358} 
13591359
1360+ #[ test]  
1361+ fn  three_branches_one_advanced_ws_commit_advanced_fully_pushed_empty_dependant ( ) 
1362+ -> anyhow:: Result < ( ) >  { 
1363+     let  ( repo,  mut  meta)  = read_only_in_memory_scenario ( 
1364+         "ws/three-branches-one-advanced-ws-commit-advanced-fully-pushed-empty-dependant" , 
1365+     ) ?; 
1366+     insta:: assert_snapshot!( visualize_commit_graph_all( & repo) ?,  @r" 
1367+     * f8f33a7 (HEAD -> gitbutler/workspace) GitButler Workspace Commit 
1368+     * cbc6713 (origin/advanced-lane, on-top-of-dependant, dependant, advanced-lane) change 
1369+     * fafd9d0 (origin/main, main, lane) init 
1370+     " ) ; 
1371+ 
1372+     add_workspace ( & mut  meta) ; 
1373+     let  graph = Graph :: from_head ( & repo,  & * meta,  standard_options ( ) ) ?. validated ( ) ?; 
1374+     insta:: assert_snapshot!( graph_tree( & graph) ,  @r" 
1375+     ├── 👉📕►►►:0:gitbutler/workspace 
1376+     │   └── ·f8f33a7 (⌂|🏘️|1) 
1377+     │       └── ►:3:advanced-lane <> origin/advanced-lane 
1378+     │           └── ·cbc6713 (⌂|🏘️|11) ►dependant, ►on-top-of-dependant 
1379+     │               └── ►:1:origin/main 
1380+     │                   └── ·fafd9d0 (⌂|🏘️|✓|11) ►lane, ►main 
1381+     └── ►:2:origin/advanced-lane 
1382+         └── →:3: (advanced-lane) 
1383+     " ) ; 
1384+ 
1385+     // By default, the advanced lane is simply frozen as its remote contains the commit. 
1386+     insta:: assert_snapshot!( graph_workspace( & graph. to_workspace( ) ?) ,  @r" 
1387+     📕🏘️:0:gitbutler/workspace <> ✓refs/remotes/origin/main 
1388+     └── ≡:3:advanced-lane <> origin/advanced-lane 
1389+         └── :3:advanced-lane <> origin/advanced-lane 
1390+             └── ❄️cbc6713 (🏘️) ►dependant, ►on-top-of-dependant 
1391+     " ) ; 
1392+ 
1393+     add_stack_with_segments ( 
1394+         & mut  meta, 
1395+         StackId :: from_number_for_testing ( 1 ) , 
1396+         "dependant" , 
1397+         StackState :: InWorkspace , 
1398+         & [ "advanced-lane" ] , 
1399+     ) ; 
1400+ 
1401+     // Lanes are properly ordered 
1402+     let  graph = Graph :: from_head ( & repo,  & * meta,  standard_options ( ) ) ?. validated ( ) ?; 
1403+     insta:: assert_snapshot!( graph_tree( & graph) ,  @r" 
1404+     ├── 👉📕►►►:0:gitbutler/workspace 
1405+     │   └── ·f8f33a7 (⌂|🏘️|1) 
1406+     │       └── 📙►:4:dependant 
1407+     │           └── 📙►:5:advanced-lane <> origin/advanced-lane 
1408+     │               └── ·cbc6713 (⌂|🏘️|11) ►on-top-of-dependant 
1409+     │                   └── ►:1:origin/main 
1410+     │                       └── ·fafd9d0 (⌂|🏘️|✓|11) ►lane, ►main 
1411+     └── ►:2:origin/advanced-lane 
1412+         └── →:4: (dependant) 
1413+     " ) ; 
1414+ 
1415+     // When putting the dependent branch on top as empty segment, the frozen state is retained. 
1416+     insta:: assert_snapshot!( graph_workspace( & graph. to_workspace( ) ?) ,  @r" 
1417+     📕🏘️:0:gitbutler/workspace <> ✓refs/remotes/origin/main 
1418+     └── ≡📙:4:dependant 
1419+         ├── 📙:4:dependant 
1420+         └── 📙:5:advanced-lane <> origin/advanced-lane 
1421+             └── ❄️cbc6713 (🏘️) ►on-top-of-dependant 
1422+     " ) ; 
1423+     Ok ( ( ) ) 
1424+ } 
1425+ 
13601426#[ test]  
13611427fn  on_top_of_target_with_history ( )  -> anyhow:: Result < ( ) >  { 
13621428    let  ( repo,  mut  meta)  = read_only_in_memory_scenario ( "ws/on-top-of-target-with-history" ) ?; 
0 commit comments