Replace special chars in branch name to prevent diff from failing

When you have special chars in branch name, the diff function fails as the file could not be created. A solution is to replace special chars in tmp modified file path