Skip to content

Commit 1500869

Browse files
fix: ignore white spaces when applying temp patch to the detached worktree
1 parent 8b74abd commit 1500869

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

codeflash/code_utils/git_utils.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,11 @@ def create_detached_worktree(module_root: Path) -> Optional[Path]:
242242

243243
# Apply the patch inside the worktree
244244
try:
245-
subprocess.run(["git", "apply", patch_path], cwd=worktree_dir, check=True)
245+
subprocess.run(
246+
["git", "apply", "--ignore-space-change", "--ignore-whitespace", patch_path],
247+
cwd=worktree_dir,
248+
check=True,
249+
)
246250
create_worktree_snapshot_commit(worktree_dir, "Initial Snapshot")
247251
except subprocess.CalledProcessError as e:
248252
logger.error(f"Failed to apply patch to worktree: {e}")

0 commit comments

Comments
 (0)