feature<Rebase>: cleanup files remained by last rebase

This commit is contained in:
leo 2021-08-03 17:07:10 +08:00
parent 6844e2d9ba
commit 3ce671af66

View file

@ -1049,6 +1049,9 @@ namespace SourceGit.Views.Widgets {
var rebaseTempFolder = Path.Combine(repo.GitDir, "rebase-apply"); var rebaseTempFolder = Path.Combine(repo.GitDir, "rebase-apply");
if (Directory.Exists(rebaseTempFolder)) Directory.Delete(rebaseTempFolder); if (Directory.Exists(rebaseTempFolder)) Directory.Delete(rebaseTempFolder);
var rebaseMergeFolder = Path.Combine(repo.GitDir, "rebase-merge");
if (Directory.Exists(rebaseMergeFolder)) Directory.Delete(rebaseMergeFolder);
return; return;
} }
@ -1097,6 +1100,12 @@ namespace SourceGit.Views.Widgets {
if (mode == "rebase") { if (mode == "rebase") {
var rebaseTempFolder = Path.Combine(repo.GitDir, "rebase-apply"); var rebaseTempFolder = Path.Combine(repo.GitDir, "rebase-apply");
if (Directory.Exists(rebaseTempFolder)) Directory.Delete(rebaseTempFolder); if (Directory.Exists(rebaseTempFolder)) Directory.Delete(rebaseTempFolder);
var rebaseFile = Path.Combine(repo.GitDir, "REBASE_HEAD");
if (File.Exists(rebaseFile)) Directory.Delete(rebaseFile);
var rebaseMergeFolder = Path.Combine(repo.GitDir, "rebase-merge");
if (Directory.Exists(rebaseMergeFolder)) Directory.Delete(rebaseMergeFolder);
} }
} }
} }