fix: Improve in-progress rebase handling (#933)

* fix: Improve in-progress rebase handling

* fix: Close merge popup even if there are conflicts (#941)
This commit is contained in:
GadflyFang 2025-02-06 10:00:35 +08:00 committed by GitHub
parent c2950ad209
commit a4157e11e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 20 additions and 9 deletions

View file

@ -107,8 +107,12 @@ namespace SourceGit.ViewModels
{
_gitDir = repo.GitDir;
var stoppedSHA = File.ReadAllText(Path.Combine(repo.GitDir, "rebase-merge", "stopped-sha")).Trim();
StoppedAt = new Commands.QuerySingleCommit(repo.FullPath, stoppedSHA).Result() ?? new Models.Commit() { SHA = stoppedSHA };
var stoppedSHAPath = Path.Combine(repo.GitDir, "rebase-merge", "stopped-sha");
if (File.Exists(stoppedSHAPath))
{
var stoppedSHA = File.ReadAllText(stoppedSHAPath).Trim();
StoppedAt = new Commands.QuerySingleCommit(repo.FullPath, stoppedSHA).Result() ?? new Models.Commit() { SHA = stoppedSHA };
}
var ontoSHA = File.ReadAllText(Path.Combine(repo.GitDir, "rebase-merge", "onto")).Trim();
Onto = new Commands.QuerySingleCommit(repo.FullPath, ontoSHA).Result() ?? new Models.Commit() { SHA = ontoSHA };