File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 11use crate :: {
22 bstr:: { BString , ByteSlice } ,
33 clone:: PrepareFetch ,
4+ config:: tree:: gitoxide,
45} ;
56
67/// The error returned by [`PrepareFetch::fetch_only()`].
@@ -80,6 +81,19 @@ impl PrepareFetch {
8081 . as_mut ( )
8182 . expect ( "user error: multiple calls are allowed only until it succeeds" ) ;
8283
84+ if repo. committer ( ) . is_none ( ) {
85+ let mut config = gix_config:: File :: new ( gix_config:: file:: Metadata :: api ( ) ) ;
86+ config
87+ . set_raw_value ( & gitoxide:: Committer :: NAME_FALLBACK , "no name configured during fetch" )
88+ . expect ( "works - statically known" ) ;
89+ config
90+ . set_raw_value ( & gitoxide:: Committer :: EMAIL_FALLBACK , "noEmailAvailable@example.com" )
91+ . expect ( "works - statically known" ) ;
92+ let mut repo_config = repo. config_snapshot_mut ( ) ;
93+ repo_config. append ( config) ;
94+ repo_config. commit ( ) . expect ( "configuration is still valid" ) ;
95+ }
96+
8397 if !self . config_overrides . is_empty ( ) {
8498 let mut snapshot = repo. config_snapshot_mut ( ) ;
8599 snapshot. append_config ( & self . config_overrides , gix_config:: Source :: Api ) ?;
You can’t perform that action at this time.
0 commit comments