enhance: show reverting commit in banner while reverting is in-progress

This commit is contained in:
leo 2024-12-10 20:57:10 +08:00
parent 2dd9cab695
commit 93d9a04460
No known key found for this signature in database
6 changed files with 36 additions and 9 deletions

View file

@ -93,7 +93,7 @@ namespace SourceGit.ViewModels
public CherryPickInProgress(Repository repo) : base(repo.FullPath, "cherry-pick", true)
{
var headSHA = File.ReadAllText(Path.Combine(repo.GitDir, "CHERRY_PICK_HEAD")).Trim();
Head = new Commands.QuerySingleCommit(repo.FullPath, headSHA).Result();
Head = new Commands.QuerySingleCommit(repo.FullPath, headSHA).Result() ?? new Models.Commit() { SHA = headSHA };
}
}
@ -171,7 +171,17 @@ namespace SourceGit.ViewModels
public class RevertInProgress : InProgressContext
{
public RevertInProgress(Repository repo) : base(repo.FullPath, "revert", false) { }
public Models.Commit Head
{
get;
private set;
}
public RevertInProgress(Repository repo) : base(repo.FullPath, "revert", false)
{
var headSHA = File.ReadAllText(Path.Combine(repo.GitDir, "REVERT_HEAD")).Trim();
Head = new Commands.QuerySingleCommit(repo.FullPath, headSHA).Result() ?? new Models.Commit() { SHA = headSHA };
}
}
public class MergeInProgress : InProgressContext