mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
refactor<*>: rewrite all codes...
This commit is contained in:
parent
89ff8aa744
commit
30ab8ae954
342 changed files with 17208 additions and 19633 deletions
19
src/Commands/Commit.cs
Normal file
19
src/Commands/Commit.cs
Normal file
|
@ -0,0 +1,19 @@
|
|||
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";
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue