sourcegit/src/Commands/Commit.cs

18 lines
455 B
C#
Raw Normal View History

2021-04-29 05:05:55 -07:00
using System.IO;
namespace SourceGit.Commands {
/// <summary>
/// `git commit`命令
/// </summary>
public class Commit : Command {
public Commit(string repo, string message, bool amend) {
var file = Path.GetTempFileName();
File.WriteAllText(file, message);
2021-04-29 05:05:55 -07:00
Cwd = repo;
Args = $"commit --file=\"{file}\"";
2021-04-29 05:05:55 -07:00
if (amend) Args += " --amend --no-edit";
}
}
}