File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
crates/gitbutler-branch-actions/src Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -372,10 +372,15 @@ impl GroupBranch<'_> {
372
372
GroupBranch :: Virtual ( branch) => {
373
373
let name_from_source = branch. source_refname . as_ref ( ) . and_then ( |n| n. branch ( ) ) ;
374
374
let name_from_upstream = branch. upstream . as_ref ( ) . map ( |n| n. branch ( ) ) ;
375
- let rich_name = branch. name . clone ( ) ;
376
- let rich_name = normalize_branch_name ( & rich_name) . ok ( ) ?;
377
- let identity = name_from_source. unwrap_or ( name_from_upstream. unwrap_or ( & rich_name) ) ;
378
- Some ( identity. into ( ) )
375
+
376
+ // If we have a source refname or upstream, use those directly
377
+ if let Some ( name) = name_from_source. or ( name_from_upstream) {
378
+ return Some ( name. into ( ) ) ;
379
+ }
380
+
381
+ // Only fall back to the normalized rich name if no source/upstream is available
382
+ let rich_name = normalize_branch_name ( & branch. name ) . ok ( ) ?;
383
+ Some ( rich_name. as_str ( ) . into ( ) )
379
384
}
380
385
}
381
386
}
You can’t perform that action at this time.
0 commit comments