radicle-surf: refactor the design: part 3

- Detect renames in Diff by default.
- Remove Vcs trait.
- Move `history()` to be a regular method of RepositoryRef.
- Update design doc.

Signed-off-by: Han Xu <keepsimple@gmail.com>
This commit is contained in:
Han Xu
2022-10-18 22:31:38 -07:00
parent 207b55494e
commit a4bc76f2ea
6 changed files with 86 additions and 130 deletions
+2 -5
View File
@@ -32,10 +32,7 @@ use crate::{
git::RepositoryRef,
object::{Error, Info, ObjectType},
revision::Revision,
vcs::{
git::{Branch, Rev},
Vcs,
},
vcs::git::{Branch, Rev},
};
/// Result of a directory listing, carries other trees and blobs.
@@ -158,7 +155,7 @@ where
entries.sort_by(|a, b| a.info.object_type.cmp(&b.info.object_type));
let last_commit = if path.is_root() {
Some(commit::Header::from(repo.get_history(rev).unwrap().first()))
Some(commit::Header::from(repo.history(rev).unwrap().first()))
} else {
None
};