Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
radicle: ensure stable sigrefs commit
Sebastian Martinez committed 3 years ago
commit d8711a8d43dc919fe39ae4b7c2f7b24667f5d470
parent 8202495e24b9dd00b4d2f422bd02b0dc83927ccc
1 file changed +12 -0
modified radicle/src/storage/refs.rs
@@ -315,6 +315,18 @@ impl SignedRefs<Verified> {

        let sigref = sigref.with_namespace(remote.into());
        let author = repo.raw().signature()?;
+

+
        #[cfg(debug_assertions)]
+
        let author = if let Ok(s) = std::env::var("RAD_COMMIT_TIME") {
+
            // SAFETY: Only used in test code.
+
            #[allow(clippy::unwrap_used)]
+
            let timestamp = s.trim().parse::<i64>().unwrap();
+
            let time = git2::Time::new(timestamp, 0);
+
            git2::Signature::new("radicle", remote.to_string().as_str(), &time)?
+
        } else {
+
            author
+
        };
+

        let commit = repo.raw().commit(
            Some(&sigref),
            &author,