File tree 2 files changed +15
-5
lines changed
gitoxide-core/src/repository 2 files changed +15
-5
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,10 @@ pub fn list(
14
14
if format != OutputFormat :: Human {
15
15
bail ! ( "Only human output format is supported at the moment" ) ;
16
16
}
17
- let mut repo = git:: open_opts ( repo. git_dir ( ) , repo. open_options ( ) . clone ( ) . lossy_config ( false ) ) ?;
18
- repo. config_snapshot_mut ( ) . apply_cli_overrides ( overrides. into_iter ( ) ) ?;
17
+ let repo = git:: open_opts (
18
+ repo. git_dir ( ) ,
19
+ repo. open_options ( ) . clone ( ) . lossy_config ( false ) . cli_overrides ( overrides) ,
20
+ ) ?;
19
21
let config = repo. config_snapshot ( ) ;
20
22
let config = config. plumbing ( ) ;
21
23
if let Some ( frontmatter) = config. frontmatter ( ) {
Original file line number Diff line number Diff line change @@ -78,14 +78,22 @@ pub fn main() -> Result<()> {
78
78
mode,
79
79
Mode :: StrictWithGitInstallConfig | Mode :: LenientWithGitInstallConfig
80
80
) ;
81
- mapping. full . permissions . config . git_binary = git_installation;
82
- mapping. reduced . permissions . config . git_binary = git_installation;
81
+ let to_match_settings = |mut opts : git:: open:: Options | {
82
+ opts. permissions . config . git_binary = git_installation;
83
+ if config. is_empty ( ) {
84
+ opts
85
+ } else {
86
+ opts. cli_overrides ( config. clone ( ) )
87
+ }
88
+ } ;
89
+ mapping. full . modify ( to_match_settings) ;
90
+ mapping. reduced . modify ( to_match_settings) ;
83
91
let mut repo = git:: ThreadSafeRepository :: discover_opts ( repository, Default :: default ( ) , mapping)
84
92
. map ( git:: Repository :: from)
85
93
. map ( |r| r. apply_environment ( ) ) ?;
86
94
if !config. is_empty ( ) {
87
95
repo. config_snapshot_mut ( )
88
- . apply_cli_overrides ( config. iter ( ) )
96
+ . append_config ( config. iter ( ) , git :: config :: Source :: Cli )
89
97
. context ( "Unable to parse command-line configuration" ) ?;
90
98
}
91
99
Ok ( repo)
You can’t perform that action at this time.
0 commit comments