mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
enhance: improve commit and stash parsing time
This commit is contained in:
parent
57540b960a
commit
ce9a3dad2f
6 changed files with 117 additions and 230 deletions
|
@ -40,17 +40,6 @@ namespace SourceGit.Models
|
|||
get => string.IsNullOrWhiteSpace(Message) ? Subject : $"{Subject}\n\n{Message}";
|
||||
}
|
||||
|
||||
public static void ParseUserAndTime(string data, ref User user, ref ulong time)
|
||||
{
|
||||
var userEndIdx = data.IndexOf('>', StringComparison.Ordinal);
|
||||
if (userEndIdx < 0)
|
||||
return;
|
||||
|
||||
var timeEndIdx = data.IndexOf(' ', userEndIdx + 2);
|
||||
user = User.FindOrAdd(data.Substring(0, userEndIdx));
|
||||
time = timeEndIdx < 0 ? 0 : ulong.Parse(data.Substring(userEndIdx + 2, timeEndIdx - userEndIdx - 2));
|
||||
}
|
||||
|
||||
private static readonly DateTime _utcStart = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc).ToLocalTime();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue