11#![ allow( clippy:: result_large_err) ]
2+
23use super :: { util, Error } ;
3- use crate :: config:: tree:: { Core , Extensions } ;
4+ use crate :: config:: cache:: util:: ApplyLeniency ;
5+ use crate :: config:: tree:: { Core , Extensions , Key } ;
46
57/// A utility to deal with the cyclic dependency between the ref store and the configuration. The ref-store needs the
68/// object hash kind, and the configuration needs the current branch name to resolve conditional includes with `onbranch`.
@@ -12,6 +14,7 @@ pub(crate) struct StageOne {
1214 pub lossy : Option < bool > ,
1315 pub object_hash : gix_hash:: Kind ,
1416 pub reflog : Option < gix_ref:: store:: WriteReflog > ,
17+ pub precompose_unicode : bool ,
1518}
1619
1720/// Initialization
@@ -69,6 +72,13 @@ impl StageOne {
6972 ) ?;
7073 config. append ( worktree_config) ;
7174 } ;
75+ let precompose_unicode = config
76+ . boolean ( "core" , None , Core :: PRECOMPOSE_UNICODE . name ( ) )
77+ . map ( |v| Core :: PRECOMPOSE_UNICODE . enrich_error ( v) )
78+ . transpose ( )
79+ . with_leniency ( lenient)
80+ . map_err ( Error :: ConfigBoolean ) ?
81+ . unwrap_or_default ( ) ;
7282
7383 let reflog = util:: query_refupdates ( & config, lenient) ?;
7484 Ok ( StageOne {
@@ -78,6 +88,7 @@ impl StageOne {
7888 lossy,
7989 object_hash,
8090 reflog,
91+ precompose_unicode,
8192 } )
8293 }
8394}
0 commit comments