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