Skip to content
This repository was archived by the owner on Dec 5, 2024. It is now read-only.

Commit 0946b03

Browse files
GitStatusEntry needs to follow our default pattern
1 parent 7ab607e commit 0946b03

File tree

1 file changed

+31
-13
lines changed

1 file changed

+31
-13
lines changed

src/GitHub.Api/Git/GitStatusEntry.cs

Lines changed: 31 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,46 @@ namespace GitHub.Unity
55
[Serializable]
66
public struct GitStatusEntry
77
{
8-
public string Path;
9-
public string FullPath;
10-
public string ProjectPath;
11-
public string OriginalPath;
12-
public GitFileStatus Status;
13-
public bool Staged;
8+
public static GitStatusEntry Default = new GitStatusEntry();
9+
10+
public string path;
11+
public string fullPath;
12+
public string projectPath;
13+
public string originalPath;
14+
public GitFileStatus status;
15+
public bool staged;
1416

1517
public GitStatusEntry(string path, string fullPath, string projectPath,
1618
GitFileStatus status,
1719
string originalPath = null, bool staged = false)
1820
{
19-
Path = path;
20-
Status = status;
21-
FullPath = fullPath;
22-
ProjectPath = projectPath;
23-
OriginalPath = originalPath;
24-
Staged = staged;
21+
Guard.ArgumentNotNullOrWhiteSpace(path, "path");
22+
Guard.ArgumentNotNullOrWhiteSpace(fullPath, "fullPath");
23+
Guard.ArgumentNotNullOrWhiteSpace(projectPath, "projectPath");
24+
25+
this.path = path;
26+
this.status = status;
27+
this.fullPath = fullPath;
28+
this.projectPath = projectPath;
29+
this.originalPath = originalPath;
30+
this.staged = staged;
2531
}
2632

33+
public string Path => path;
34+
35+
public string FullPath => fullPath;
36+
37+
public string ProjectPath => projectPath;
38+
39+
public string OriginalPath => originalPath;
40+
41+
public GitFileStatus Status => status;
42+
43+
public bool Staged => staged;
44+
2745
public override string ToString()
2846
{
29-
return String.Format("Path:'{0}' Status:'{1}' FullPath:'{2}' ProjectPath:'{3}' OriginalPath:'{4}' Staged:'{5}'", Path, Status, FullPath, ProjectPath, OriginalPath, Staged);
47+
return $"Path:'{Path}' Status:'{Status}' FullPath:'{FullPath}' ProjectPath:'{ProjectPath}' OriginalPath:'{OriginalPath}' Staged:'{Staged}'";
3048
}
3149
}
3250
}

0 commit comments

Comments
 (0)