radicle-dev / radicle-git

Everything Radicle growing around Git
Other
35 stars 5 forks source link

`diff::Moved` might require object IDs and file modes #140

Closed slack-coder closed 10 months ago

slack-coder commented 11 months ago

A recent Radicle Patch for heartwood indicates git files which are moved can have oids and file modes.

git show c55badf0b8bee38e425d297decbd3560fad3c5e7 | grep -A5 b/radicle/src/node/tracking/config.rs
diff --git a/radicle-node/src/service/tracking.rs b/radicle/src/node/tracking/config.rs
similarity index 96%
rename from radicle-node/src/service/tracking.rs
rename to radicle/src/node/tracking/config.rs
index cbc843c8..3f69208f 100644

However diff::Moved uses PathBuf as fields, where DiffFile might be better:

pub struct Moved {
    /// The old path to this file, relative to the repository root.
    pub old_path: PathBuf,
    /// The new path to this file, relative to the repository root.
    pub new_path: PathBuf,
    pub diff: DiffContent,
}
FintanH commented 10 months ago

Good catch. I also realised we're not serializing the diff content for compatibility reasons. I'm thinking we could serialize them only if there is a move with a change.