mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-24 20:05:00 +00:00
feature: allow to reset author when --amend
is enabled for committing
This commit is contained in:
parent
d3bc85418e
commit
0641a22230
8 changed files with 38 additions and 12 deletions
|
@ -4,7 +4,7 @@ namespace SourceGit.Commands
|
|||
{
|
||||
public class Commit : Command
|
||||
{
|
||||
public Commit(string repo, string message, bool amend, bool signOff)
|
||||
public Commit(string repo, string message, bool signOff, bool amend, bool resetAuthor)
|
||||
{
|
||||
_tmpFile = Path.GetTempFileName();
|
||||
File.WriteAllText(_tmpFile, message);
|
||||
|
@ -12,10 +12,10 @@ namespace SourceGit.Commands
|
|||
WorkingDirectory = repo;
|
||||
Context = repo;
|
||||
Args = $"commit --allow-empty --file=\"{_tmpFile}\"";
|
||||
if (amend)
|
||||
Args += " --amend --no-edit";
|
||||
if (signOff)
|
||||
Args += " --signoff";
|
||||
if (amend)
|
||||
Args += resetAuthor ? " --amend --reset-author --no-edit" : " --amend --no-edit";
|
||||
}
|
||||
|
||||
public bool Run()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue