mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-10-28 07:30:51 +08:00
radicle-surf: remove diff function
Remove the `Diff::diff` as it is unused. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett
This commit is contained in:
@@ -22,11 +22,6 @@ use std::{convert::TryFrom, path::PathBuf, slice};
|
||||
#[cfg(feature = "serialize")]
|
||||
use serde::{ser, Serialize, Serializer};
|
||||
|
||||
use crate::{
|
||||
file_system::Directory,
|
||||
git::{Error, Repository},
|
||||
};
|
||||
|
||||
pub mod git;
|
||||
|
||||
#[cfg_attr(
|
||||
@@ -293,20 +288,6 @@ impl Diff {
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: Direction of comparison is not obvious with this signature.
|
||||
// For now using conventional approach with the right being "newer".
|
||||
#[allow(clippy::self_named_constructors)]
|
||||
pub fn diff(left: Directory, right: Directory, repo: Repository) -> Result<Self, Error> {
|
||||
// TODO: Some of the deleted files may actually be moved (renamed) to one of the
|
||||
// created files. Finding out which of the deleted files were deleted
|
||||
// and which were moved will probably require performing some variant of
|
||||
// the longest common substring algorithm for each pair in D x C. Final
|
||||
// decision can be based on heuristics, e.g. the file can be considered
|
||||
// moved, if len(LCS) > 0,25 * min(size(d), size(c)), and
|
||||
// deleted otherwise.
|
||||
repo.diff(left, right)
|
||||
}
|
||||
|
||||
pub(crate) fn add_modified_file(
|
||||
&mut self,
|
||||
path: PathBuf,
|
||||
|
||||
Reference in New Issue
Block a user