mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-10-18 19:10:31 +08:00
radicle-surf: source module
This is a straightforward move of all the code source browsing modules into a module called `source`. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
+1
-12
@@ -82,18 +82,7 @@ extern crate radicle_git_ext as git_ext;
|
||||
pub mod diff;
|
||||
pub mod file_system;
|
||||
pub mod git;
|
||||
|
||||
pub mod commit;
|
||||
pub use commit::{commit, commits, Commit};
|
||||
|
||||
pub mod object;
|
||||
pub use object::{blob, tree as objectTree, Blob, BlobContent, Info, ObjectType, Tree};
|
||||
|
||||
pub mod person;
|
||||
pub use person::Person;
|
||||
|
||||
pub mod revision;
|
||||
pub use revision::Revision;
|
||||
pub mod source;
|
||||
|
||||
#[cfg(feature = "syntax")]
|
||||
pub mod syntax;
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
//! The `source` module provides a layer on top of the [`crate::git`]
|
||||
//! functionality.
|
||||
//!
|
||||
//! It provides data types of [`Blob`]s, [`Tree`]s, and [`Commit`]s
|
||||
//! (see [git objects][git-objects]). These types are analgous to
|
||||
//! [`crate::file_system::File`], [`crate::file_system::Directory`], and
|
||||
//! [`crate::git::Commit`]. However, they provide extra metadata and
|
||||
//! can be serialized to serve to other applications. For example,
|
||||
//! they could be used in an HTTP server for viewing a Git repository.
|
||||
//!
|
||||
//! [git-objects]: https://git-scm.com/book/en/v2/Git-Internals-Git-Objects
|
||||
|
||||
pub mod object;
|
||||
pub use object::{blob, tree, Blob, BlobContent, Info, ObjectType, Tree};
|
||||
|
||||
pub mod commit;
|
||||
pub use commit::{commit, commits, Commit};
|
||||
|
||||
pub mod person;
|
||||
pub use person::Person;
|
||||
|
||||
pub mod revision;
|
||||
pub use revision::Revision;
|
||||
@@ -29,8 +29,7 @@ use serde::{
|
||||
use crate::{
|
||||
diff,
|
||||
git::{self, glob, Glob, Repository},
|
||||
person::Person,
|
||||
revision::Revision,
|
||||
source::{person::Person, revision::Revision},
|
||||
};
|
||||
|
||||
use radicle_git_ext::Oid;
|
||||
@@ -32,7 +32,7 @@ pub use blob::{Blob, BlobContent};
|
||||
pub mod tree;
|
||||
pub use tree::{tree, Tree, TreeEntry};
|
||||
|
||||
use crate::{commit, file_system::directory, git};
|
||||
use crate::{file_system::directory, git, source::commit};
|
||||
|
||||
/// Git object types.
|
||||
///
|
||||
@@ -30,10 +30,12 @@ use serde::{
|
||||
};
|
||||
|
||||
use crate::{
|
||||
commit,
|
||||
git::Repository,
|
||||
object::{Error, Info, ObjectType},
|
||||
revision::Revision,
|
||||
source::{
|
||||
commit,
|
||||
object::{Error, Info, ObjectType},
|
||||
revision::Revision,
|
||||
},
|
||||
};
|
||||
|
||||
#[cfg(feature = "syntax")]
|
||||
@@ -28,11 +28,13 @@ use serde::{
|
||||
};
|
||||
|
||||
use crate::{
|
||||
commit,
|
||||
file_system::directory,
|
||||
git::Repository,
|
||||
object::{Error, Info, ObjectType},
|
||||
revision::Revision,
|
||||
source::{
|
||||
commit,
|
||||
object::{Error, Info, ObjectType},
|
||||
revision::Revision,
|
||||
},
|
||||
};
|
||||
|
||||
/// Result of a directory listing, carries other trees and blobs.
|
||||
Reference in New Issue
Block a user