Browse Source

Do not expect sha field in API response

We should eventually add in-CI testing for this kind of oops (it's
fairly common when we change these) or move to auto-generated GitHub API
code -- but for now this fixes commit fetching.
Mark Rousskov 2 năm trước cách đây
mục cha
commit
fef2551778
1 tập tin đã thay đổi với 8 bổ sung1 xóa
  1. 8 1
      src/github.rs

+ 8 - 1
src/github.rs

@@ -1928,10 +1928,17 @@ impl GithubClient {
 #[derive(Debug, serde::Deserialize)]
 pub struct GithubCommit {
     pub sha: String,
-    pub commit: GitCommit,
+    pub commit: GithubCommitCommitField,
     pub parents: Vec<Parent>,
 }
 
+#[derive(Debug, serde::Deserialize)]
+pub struct GithubCommitCommitField {
+    pub author: GitUser,
+    pub message: String,
+    pub tree: GitCommitTree,
+}
+
 #[derive(Debug, serde::Deserialize)]
 pub struct GitCommit {
     pub sha: String,