diff --git a/Sparkles/Git/Git.Repository.cs b/Sparkles/Git/Git.Repository.cs index dbebaa6d..3d0433cc 100644 --- a/Sparkles/Git/Git.Repository.cs +++ b/Sparkles/Git/Git.Repository.cs @@ -934,7 +934,12 @@ namespace Sparkles.Git { string HEAD_file_path = Path.Combine (child_path, "HEAD"); if (File.Exists (HEAD_file_path)) { - File.Move (HEAD_file_path, HEAD_file_path + ".backup"); + string HEAD_file_path_backup = Path.Combine (child_path, "HEAD.backup"); + if (File.Exists (HEAD_file_path_backup)) { + File.Delete (HEAD_file_path_backup); + } + + File.Move (HEAD_file_path, HEAD_file_path_backup); Logger.LogInfo ("Git", Name + " | Renamed " + HEAD_file_path); }