1377 - Ignore files call moved to ensure_repo
1377 - Renamed variable ignore_file to a most accurate one (path)
1377 - Fix function. Truncate before write. To avoid seek lose problem.