File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change 1818
1919def create_worktree_snapshot_commit (worktree_dir : Path , commit_message : str ) -> None :
2020 repository = git .Repo (worktree_dir , search_parent_directories = True )
21+ username = None
22+ email = None
23+ with repository .config_reader () as cr :
24+ username = cr .remove_option ("user" , "name" )
25+ email = cr .remove_option ("user" , "email" )
26+ repository .git .config ()
27+ with repository .config_writer () as cw :
28+ if not cw .has_option ("user" , "name" ):
29+ cw .set_value ("user" , "name" , "Codeflash Bot" )
30+ if not cw .has_option ("user" , "email" ):
31+ cw .
set_value (
"user" ,
"email" ,
"[email protected] " )
2132
2233 repository .git .add ("." )
2334 repository .git .commit ("-m" , commit_message , "--no-verify" )
35+ with repository .config_writer () as cw :
36+ if username :
37+ cw .set_value ("user" , "name" , username )
38+ if email :
39+ cw .set_value ("user" , "email" , email )
2440
2541
2642def create_detached_worktree (module_root : Path ) -> Optional [Path ]:
You can’t perform that action at this time.
0 commit comments