Skip to content

Commit e77eecf

Browse files
set git config when creating the worktree commit snapshot if not exist
1 parent 6b3a020 commit e77eecf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

codeflash/code_utils/git_worktree_utils.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,12 @@ def get_git_project_id() -> str:
3434

3535
def create_worktree_snapshot_commit(worktree_dir: Path, commit_message: str) -> None:
3636
repository = git.Repo(worktree_dir, search_parent_directories=True)
37+
with repository.config_writer() as cw:
38+
if not cw.has_option("user", "name"):
39+
cw.set_value("user", "name", "Codeflash Bot")
40+
if not cw.has_option("user", "email"):
41+
cw.set_value("user", "email", "bot@codeflash.ai")
42+
3743
repository.git.add(".")
3844
repository.git.commit("-m", commit_message, "--no-verify")
3945

0 commit comments

Comments
 (0)