sourcegit/src/Commands/Commit.cs
2021-04-29 20:05:55 +08:00

19 lines
484 B
C#

using System.IO;
namespace SourceGit.Commands {
/// <summary>
/// `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);
Cwd = repo;
Args = $"commit --file=\"{msg}\"";
if (amend) Args += " --amend --no-edit";
}
}
}