mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 04:04:59 +00:00
enhance: make commit's subject the same with pretty print parameter %s
in git log
command
This commit is contained in:
parent
b4e01a8b93
commit
78c7168a46
6 changed files with 98 additions and 83 deletions
|
@ -84,17 +84,25 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
if (SetProperty(ref _useAmend, value) && value)
|
||||
{
|
||||
var commits = new Commands.QueryCommits(_repo.FullPath, "-n 1", false).Result();
|
||||
if (commits.Count == 0)
|
||||
var currentBranch = _repo.Branches.Find(x => x.IsCurrent);
|
||||
if (currentBranch == null)
|
||||
{
|
||||
App.RaiseException(_repo.FullPath, "No commits to amend!!!");
|
||||
_useAmend = false;
|
||||
OnPropertyChanged();
|
||||
return;
|
||||
}
|
||||
else
|
||||
|
||||
var head = new Commands.QuerySingleCommit(_repo.FullPath, currentBranch.Head).Result();
|
||||
if (head == null)
|
||||
{
|
||||
CommitMessage = commits[0].Body;
|
||||
App.RaiseException(_repo.FullPath, "No commits to amend!!!");
|
||||
_useAmend = false;
|
||||
OnPropertyChanged();
|
||||
return;
|
||||
}
|
||||
|
||||
CommitMessage = head.Body;
|
||||
}
|
||||
|
||||
OnPropertyChanged(nameof(IsCommitWithPushVisible));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue