Write a command-line tool patch tool that applies a unified-diff patch file to a target file. The tool…
Write a command-line tool patch tool that applies a unified-diff patch file to a target file. The tool…: a task in TermGrade Environments: 1,004 executable Linux tasks (Harbor dataset). Input/Output contract: - TARGET FILE : a path to an existing regular file (any encoding, but treat as binary…
The task
**Input/Output contract:** - `TARGET_FILE`: a path to an existing regular file (any encoding, but treat as binary bytes). - `PATCH_FILE`: a path to a unified-diff file (potentially containing multiple hunks, possibly with context lines that overlap or are out of order). - The tool reads the target file, applies all…
Part of ai-and/termgrade-environments.