apply_patch doesn't create parent directories when creating a new file leading to confusion and flailing by the agent. This will create parent directories automatically when absent. ---------