Skip to content

Commit

Permalink
完成获取所有的日志内容
Browse files Browse the repository at this point in the history
  • Loading branch information
lindexi committed Nov 12, 2024
1 parent 5ffa402 commit 8b08327
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions package/GitCommand/GitCommand/Git.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,14 @@ public List<GitDiffFile> DiffFile(string source, string target)

public string[] GetLogCommit()
{
var file = Path.GetTempFileName();
RunGitCommand($"log --pretty=format:\"%H\" > {file}");
var (success, control) = RunGitCommand($"log --pretty=format:\"%H\"");

return File.ReadAllLines(file);
if (!success)
{
return Array.Empty<string>();
}

return control.Split('\n');
}

public string GetCurrentCommit()
Expand Down

0 comments on commit 8b08327

Please sign in to comment.