JavaScript is disabled, refresh for a better experience. ambee/giterated

ambee/giterated

Git repository hosting, collaboration, and discovery for the Fediverse.

Add new_commit to diff response

erremilia - ⁨2⁩ years ago

parent: tbd commit: ⁨b7d85f0

Showing ⁨⁨2⁩ changed files⁩ with ⁨⁨4⁩ insertions⁩ and ⁨⁨0⁩ deletions⁩

giterated-daemon/src/backend/git.rs

View file
@@ -756,6 +756,7 @@ impl RepositoryBackend for GitBackend {
756 756 .unwrap();
757 757
758 758 Ok(RepositoryDiff {
759 new_commit: Commit::from(commit_new),
759 760 files_changed: stats.files_changed(),
760 761 insertions: stats.insertions(),
761 762 deletions: stats.deletions(),

giterated-models/src/repository/mod.rs

View file
@@ -149,6 +149,8 @@ pub struct RepositoryFile {
149 149
150 150 #[derive(Clone, Debug, Serialize, Deserialize)]
151 151 pub struct RepositoryDiff {
152 /// "to" side of the diff commit
153 pub new_commit: Commit,
152 154 /// Total number of files changed
153 155 pub files_changed: usize,
154 156 /// Total number of insertions
@@ -183,6 +185,7 @@ pub struct RepositoryTreeEntry {
183 185 }
184 186
185 187 impl RepositoryTreeEntry {
188 // I love you Emilia <3
186 189 pub fn new(id: &str, name: &str, object_type: RepositoryObjectType, mode: i32) -> Self {
187 190 Self {
188 191 id: id.to_string(),