-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathFileChange.cs
29 lines (22 loc) · 961 Bytes
/
FileChange.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (c) Ubisoft. All Rights Reserved.
// Licensed under the Apache License, Version 2.0.
using LibGit2Sharp;
namespace GitTimelapseView.Core.Models
{
public sealed class FileChange
{
public FileChange(Commit commit, TreeEntryChanges change, string workingDirectory)
{
Commit = commit;
ChangeKind = change.Status;
Path = string.IsNullOrEmpty(change.Path) ? string.Empty : System.IO.Path.GetFullPath(System.IO.Path.Combine(workingDirectory, change.Path));
OldPath = string.IsNullOrEmpty(change.OldPath) ? string.Empty : System.IO.Path.GetFullPath(System.IO.Path.Combine(workingDirectory, change.OldPath));
Name = System.IO.Path.GetFileName(Path);
}
public ChangeKind ChangeKind { get; }
public Commit Commit { get; }
public string Name { get; }
public string Path { get; }
public string OldPath { get; }
}
}