refactor(Repository): using temp file to store commit message instead of file in .git folder

This commit is contained in:
leo 2020-07-21 13:43:56 +08:00
parent 005073f847
commit b1310a5fd0

View file

@ -686,7 +686,7 @@ namespace SourceGit.Git {
public bool DoCommit(string message, bool amend) {
isWatcherDisabled = true;
var file = System.IO.Path.Combine(Path, ".git", "COMMITMESSAGE");
var file = System.IO.Path.GetTempFileName();
File.WriteAllText(file, message);
var args = $"commit --file=\"{file}\"";