diff --git a/radicle-httpd/src/api/json.rs b/radicle-httpd/src/api/json.rs index 27ed4614..212beaac 100644 --- a/radicle-httpd/src/api/json.rs +++ b/radicle-httpd/src/api/json.rs @@ -18,7 +18,7 @@ use radicle::node::{Alias, AliasStore}; use radicle::prelude::NodeId; use radicle::storage::{git, refs, RemoteRepository}; use radicle_surf::blob::Blob; -use radicle_surf::tree::Tree; +use radicle_surf::tree::{EntryKind, Tree}; use radicle_surf::{Commit, Oid, Stats}; use crate::api::auth::Session; @@ -82,8 +82,13 @@ pub(crate) fn tree(tree: &Tree, path: &str, stats: &Stats) -> Value { .map(|entry| { json!({ "path": prefix.join(entry.name()), + "oid": entry.object_id(), "name": entry.name(), - "kind": if entry.is_tree() { "tree" } else { "blob" }, + "kind": match entry.entry() { + EntryKind::Tree(_) => "tree", + EntryKind::Blob(_) => "blob", + EntryKind::Submodule { .. } => "submodule" + }, }) }) .collect::>(); diff --git a/radicle-httpd/src/api/v1/projects.rs b/radicle-httpd/src/api/v1/projects.rs index 908b99a7..9d23a4b7 100644 --- a/radicle-httpd/src/api/v1/projects.rs +++ b/radicle-httpd/src/api/v1/projects.rs @@ -1678,11 +1678,13 @@ mod routes { "entries": [ { "path": "dir1", + "oid": "2d1c3cbfcf1d190d7fc77ac8f9e53db0e91a9ad3", "name": "dir1", "kind": "tree" }, { "path": "README", + "oid": "980a0d5f19a64b4b30a87d4206aade58726b60e3", "name": "README", "kind": "blob" } @@ -1707,8 +1709,8 @@ mod routes { "name": "", "path": "", "stats": { - "branches": 1, "commits": 3, + "branches": 1, "contributors": 1 } } @@ -1724,6 +1726,7 @@ mod routes { "entries": [ { "path": "dir1/README", + "oid": "1dd5654ca2d2cf9f33b14c92b5ca9e1d21a91ae1", "name": "README", "kind": "blob" }