mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
feature<Histories>: add reword/squash context menu for HEAD commit
This commit is contained in:
parent
76f192785c
commit
59fa5304d8
9 changed files with 279 additions and 6 deletions
|
@ -5,14 +5,12 @@ namespace SourceGit.Commands {
|
|||
/// `git commit`命令
|
||||
/// </summary>
|
||||
public class Commit : Command {
|
||||
private string msg = null;
|
||||
|
||||
public Commit(string repo, string message, bool amend) {
|
||||
msg = Path.GetTempFileName();
|
||||
File.WriteAllText(msg, message);
|
||||
var file = Path.GetTempFileName();
|
||||
File.WriteAllText(file, message);
|
||||
|
||||
Cwd = repo;
|
||||
Args = $"commit --file=\"{msg}\"";
|
||||
Args = $"commit --file=\"{file}\"";
|
||||
if (amend) Args += " --amend --no-edit";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue