User Auth Early
parent: tbd commit: 8069fba
1 | use ; |
2 | |
3 | use ; |
4 | |
5 | |
6 | |
7 | /// Name of the repository. |
8 | /// |
9 | /// This must be treated as an opaque path to a repository. Do not |
10 | /// modify or parse the path. |
11 | pub name: String, |
12 | /// Instance the repository is on |
13 | pub instance: Instance, |
14 | |
15 | |
16 | /// Visibility of the repository to the general eye |
17 | |
18 | |
19 | |
20 | Public, |
21 | Unlisted, |
22 | Private, |
23 | |
24 | |
25 | |
26 | |
27 | /// Name of the repository |
28 | /// |
29 | /// This is different than the [`Repository`] name, |
30 | /// which may be a path. |
31 | pub name: String, |
32 | /// Owner of the Repository |
33 | pub owner: User, |
34 | /// Repository description |
35 | pub description: , |
36 | /// Repository visibility |
37 | pub visibility: RepositoryVisibility, |
38 | /// Default branch of the repository |
39 | pub default_branch: String, |
40 | /// Last commit made to the repository |
41 | pub latest_commit: , |
42 | /// Revision of the displayed tree |
43 | pub tree_rev: , |
44 | /// Repository tree |
45 | pub tree: , |
46 | |
47 | |
48 | |
49 | |
50 | Tree, |
51 | Blob, |
52 | |
53 | |
54 | /// Stored info for our tree entries |
55 | |
56 | |
57 | /// Name of the tree/blob |
58 | pub name: String, |
59 | /// Type of the tree entry |
60 | pub object_type: RepositoryObjectType, |
61 | /// Git supplies us with the mode at all times, and people like it displayed. |
62 | pub mode: i32, |
63 | /// File size |
64 | pub size: , |
65 | /// Last commit made to the tree/blob |
66 | pub last_commit: , |
67 | |
68 | |
69 | |
70 | // I love you Emilia <3 |
71 | |
72 | Self |
73 | name: name.to_string, |
74 | object_type, |
75 | mode, |
76 | size: None, |
77 | last_commit: None, |
78 | |
79 | |
80 | |
81 | |
82 | |
83 | |
84 | pub tree_entry: RepositoryTreeEntry, |
85 | pub commit: Commit, |
86 | |
87 | |
88 | /// Info about a git commit |
89 | |
90 | |
91 | /// Unique commit ID |
92 | pub oid: String, |
93 | /// Full commit message |
94 | pub message: , |
95 | /// Who created the commit |
96 | pub author: CommitSignature, |
97 | /// Who committed the commit |
98 | pub committer: CommitSignature, |
99 | /// Time when the commit happened |
100 | pub time: NaiveDateTime, |
101 | |
102 | |
103 | /// Gets all info from [`git2::Commit`] for easy use |
104 | |
105 | |
106 | Self |
107 | oid: commit.id .to_string, |
108 | message: commit.message .map, |
109 | author: commit.author .into, |
110 | committer: commit.committer .into, |
111 | time: from_timestamp_opt .unwrap, |
112 | |
113 | |
114 | |
115 | |
116 | /// Git commit signature |
117 | |
118 | |
119 | pub name: , |
120 | pub email: , |
121 | pub time: NaiveDateTime, |
122 | |
123 | |
124 | /// Converts the signature from git2 into something usable without explicit lifetimes. |
125 | |
126 | |
127 | Self |
128 | name: signature.name .map, |
129 | email: signature.email .map, |
130 | time: from_timestamp_opt .unwrap, |
131 | |
132 | |
133 | |
134 | |
135 | |
136 | |
137 | format! |
138 | |
139 | |
140 |