mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 20:24:59 +00:00
style: add .editorconfig for code formatting. see issu #25
This commit is contained in:
parent
a8eeea4f78
commit
18aaa0a143
225 changed files with 7781 additions and 3911 deletions
|
@ -1,9 +1,12 @@
|
|||
using Avalonia;
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace SourceGit.Models {
|
||||
public class Commit {
|
||||
using Avalonia;
|
||||
|
||||
namespace SourceGit.Models
|
||||
{
|
||||
public class Commit
|
||||
{
|
||||
public string SHA { get; set; } = string.Empty;
|
||||
public User Author { get; set; } = User.Invalid;
|
||||
public ulong AuthorTime { get; set; } = 0;
|
||||
|
@ -22,15 +25,18 @@ namespace SourceGit.Models {
|
|||
public string AuthorTimeShortStr => _utcStart.AddSeconds(AuthorTime).ToString("yyyy/MM/dd");
|
||||
public string CommitterTimeShortStr => _utcStart.AddSeconds(CommitterTime).ToString("yyyy/MM/dd");
|
||||
|
||||
public bool IsCommitterVisible {
|
||||
public bool IsCommitterVisible
|
||||
{
|
||||
get => Author != Committer || AuthorTime != CommitterTime;
|
||||
}
|
||||
|
||||
public string FullMessage {
|
||||
public string FullMessage
|
||||
{
|
||||
get => string.IsNullOrWhiteSpace(Message) ? Subject : $"{Subject}\n\n{Message}";
|
||||
}
|
||||
|
||||
public static void ParseUserAndTime(string data, ref User user, ref ulong time) {
|
||||
public static void ParseUserAndTime(string data, ref User user, ref ulong time)
|
||||
{
|
||||
var userEndIdx = data.IndexOf('>', StringComparison.Ordinal);
|
||||
if (userEndIdx < 0) return;
|
||||
|
||||
|
@ -41,4 +47,4 @@ namespace SourceGit.Models {
|
|||
|
||||
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