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 8b08327 commit d739f83
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 @@ -107,10 +107,14 @@ public static string GetFileLastModificationDate(FileInfo file)

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

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

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

#endregion
Expand Down

0 comments on commit d739f83

Please sign in to comment.