Radish alpha
r
rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt
Git libraries for Radicle
Radicle
Git
nix: update to rust-1.67
Fintan Halpenny committed 3 years ago
commit 703692371260a19ecf79abd7c38bd511c6c120dc
parent 4802259
27 files changed +40 -47
modified git-commit/Cargo.toml
@@ -14,7 +14,7 @@ keywords = ["git", "radicle"]
thiserror = "1"

[dependencies.git2]
-
version = "0.15.0"
+
version = "0.16.1"
default-features = false
features = ["vendored-libgit2"]

modified git-commit/src/lib.rs
@@ -276,14 +276,14 @@ impl ToString for Commit {
        writeln!(buf, "tree {}", self.tree).ok();

        for parent in &self.parents {
-
            writeln!(buf, "parent {}", parent).ok();
+
            writeln!(buf, "parent {parent}").ok();
        }

        writeln!(buf, "author {}", self.author).ok();
        writeln!(buf, "committer {}", self.committer).ok();

        for (name, value) in self.headers.iter() {
-
            writeln!(buf, "{} {}", name, value.replace('\n', "\n ")).ok();
+
            writeln!(buf, "{name} {}", value.replace('\n', "\n ")).ok();
        }
        writeln!(buf).ok();
        write!(buf, "{}", self.message.trim()).ok();
modified git-commit/t/Cargo.toml
@@ -18,7 +18,7 @@ test = []
path = ".."

[dev-dependencies.git2]
-
version = "0.15.0"
+
version = "0.16.1"
default-features = false
features = ["vendored-libgit2"]

modified git-commit/t/src/integration.rs
@@ -23,6 +23,6 @@ fn valid_commits() {
    for oid in walk.take(20) {
        let oid = oid.unwrap();
        let commit = Commit::read(&repo, oid);
-
        assert!(commit.is_ok(), "Oid: {}, Error: {:?}", oid, commit)
+
        assert!(commit.is_ok(), "Oid: {oid}, Error: {commit:?}")
    }
}
modified git-storage/Cargo.toml
@@ -13,7 +13,7 @@ thiserror = "1"
either = "1.8.0"

[dependencies.git2]
-
version = "0.15.0"
+
version = "0.16.1"
default-features = false
features = ["vendored-libgit2"]

@@ -21,7 +21,7 @@ features = ["vendored-libgit2"]
path = "../git-ref-format"

[dependencies.libgit2-sys]
-
version = ">= 0.12.24"
+
version = ">= 0.14.2"
default-features = false
features = ["vendored"]

modified git-storage/src/backend/write.rs
@@ -540,10 +540,10 @@ impl odb::Write for Write {
        self.as_raw().blob(data).map(Oid::from)
    }

-
    fn write_commit<'b>(
+
    fn write_commit(
        &self,
        tree: &odb::Tree,
-
        parents: &[&odb::Commit<'b>],
+
        parents: &[&odb::Commit<'_>],
        message: &str,
    ) -> Result<Oid, Self::WriteCommit> {
        let author = self.info.signature()?;
modified git-storage/src/odb/write.rs
@@ -36,10 +36,10 @@ pub trait Write: Read {
    /// The commit will not be associated with any reference. If this is
    /// required then you can use the [`Oid`] as the target for a
    /// [`crate::refdb::Update`].
-
    fn write_commit<'a>(
+
    fn write_commit(
        &self,
        tree: &Tree,
-
        parents: &[&Commit<'a>],
+
        parents: &[&Commit<'_>],
        message: &str,
    ) -> Result<Oid, Self::WriteCommit>;

modified git-storage/t/Cargo.toml
@@ -21,7 +21,7 @@ proptest = "1"
path = ".."

[dependencies.git2]
-
version = "0.15.0"
+
version = "0.16.1"
default-features = false
features = ["vendored-libgit2"]

modified git-storage/t/src/tmp.rs
@@ -8,7 +8,7 @@ pub type TmpRepo = WithTmpDir<Repository>;
pub fn writer(user: UserInfo) -> TmpWriter {
    WithTmpDir::new(|path| {
        Write::open(path, user)
-
            .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, format!("{}", e)))
+
            .map_err(|e| std::io::Error::new(std::io::ErrorKind::Other, e.to_string()))
    })
    .unwrap()
}
modified link-git/Cargo.toml
@@ -58,7 +58,7 @@ features = ["async-client"]

# compat
[dependencies.git2]
-
version = "0.15.0"
+
version = "0.16.1"
default-features = false
features = ["vendored-libgit2"]
optional = true
modified link-git/src/protocol/transport.rs
@@ -27,7 +27,7 @@ where
    W: AsyncWrite + Unpin,
{
    pub fn new(repo: BString, recv: R, send: W) -> Self {
-
        let url = format!("rad://{}", repo);
+
        let url = format!("rad://{repo}");
        let inner = Connection::new(
            recv,
            send,
modified link-git/src/protocol/upload_pack.rs
@@ -147,7 +147,7 @@ where
                    std::env::vars()
                        .filter(|(key, _)| key == "PATH" || key.starts_with("GIT_TRACE")),
                )
-
                .env("GIT_PROTOCOL", format!("version={}", protocol_version))
+
                .env("GIT_PROTOCOL", format!("version={protocol_version}"))
                .env("GIT_NAMESPACE", namespace)
                .args([
                    "-c",
modified link-git/src/protocol/upload_pack/legacy.rs
@@ -64,10 +64,7 @@ where
            .arg("-c")
            .arg("uploadpack.hiderefs=refs/")
            .arg("-c")
-
            .arg(format!(
-
                "uploadpack.hiderefs=!refs/namespaces/{}",
-
                namespace
-
            ));
+
            .arg(format!("uploadpack.hiderefs=!refs/namespaces/{namespace}",));

        for r in unhide {
            cmd.arg("-c")
modified link-git/t/Cargo.toml
@@ -22,7 +22,7 @@ futures_ringbuf = "0.3"
tempfile = "3.3"

[dev-dependencies.git2]
-
version = "0.15.0"
+
version = "0.16.1"
default-features = false
features = ["vendored-libgit2"]

modified nix/sources.json
@@ -5,10 +5,10 @@
        "homepage": "https://github.com/nmattia/niv",
        "owner": "nmattia",
        "repo": "niv",
-
        "rev": "351d8bc316bf901a81885bab5f52687ec8ccab6e",
-
        "sha256": "1yzhz7ihkh6p2sxhp3amqfbmm2yqzaadqqii1xijymvl8alw5rrr",
+
        "rev": "689d0e5539eddd0b0f566aee7bb18629eee7df74",
+
        "sha256": "1rld3lk42l6b01f2gcrhq8qm9vry1awmfl29zmpiqda9dy89vbx0",
        "type": "tarball",
-
        "url": "https://github.com/nmattia/niv/archive/351d8bc316bf901a81885bab5f52687ec8ccab6e.tar.gz",
+
        "url": "https://github.com/nmattia/niv/archive/689d0e5539eddd0b0f566aee7bb18629eee7df74.tar.gz",
        "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
    },
    "nixpkgs": {
@@ -29,10 +29,10 @@
        "homepage": "",
        "owner": "oxalica",
        "repo": "rust-overlay",
-
        "rev": "7da2f6b3a0c32f661cb2864d7fbd1d7e6f0c7543",
-
        "sha256": "1daw246p4aimvx9h3cf034dsyimh9d2ww19v4fx45mcmlqw1mx42",
+
        "rev": "7093dfcd21df83026ee20426af80bf2072e2da92",
+
        "sha256": "0qp84wa1imc0cij7hv5y8wy04z0nh9d444k1wabdli3prcqq3pvx",
        "type": "tarball",
-
        "url": "https://github.com/oxalica/rust-overlay/archive/7da2f6b3a0c32f661cb2864d7fbd1d7e6f0c7543.tar.gz",
+
        "url": "https://github.com/oxalica/rust-overlay/archive/7093dfcd21df83026ee20426af80bf2072e2da92.tar.gz",
        "url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
    }
}
modified radicle-git-ext/Cargo.toml
@@ -19,7 +19,7 @@ percent-encoding = "2"
thiserror = "1"

[dependencies.git2]
-
version = "0.15.0"
+
version = "0.16.1"
default-features = false
features = ["vendored-libgit2"]

modified radicle-git-ext/src/reference/name.rs
@@ -340,7 +340,7 @@ impl OneLevel {
    }

    pub fn into_qualified(self, category: RefLike) -> Qualified {
-
        Qualified(format!("refs/{}/{}", category, self))
+
        Qualified(format!("refs/{category}/{self}"))
    }
}

@@ -454,7 +454,7 @@ impl From<RefLike> for Qualified {
        if path.starts_with("refs/") {
            Self(path)
        } else {
-
            Self(format!("refs/heads/{}", path))
+
            Self(format!("refs/heads/{path}"))
        }
    }
}
modified radicle-git-ext/t/Cargo.toml
@@ -24,7 +24,7 @@ serde = "1"
serde_json = "1"

[dependencies.git2]
-
version = "0.15.0"
+
version = "0.16.1"
default-features = false
features = ["vendored-libgit2"]

modified radicle-git-types/Cargo.toml
@@ -17,7 +17,7 @@ thiserror = "1.0.30"
tracing = "0.1"

[dependencies.git2]
-
version = "0.15.0"
+
version = "0.16.1"
default-features = false
features = ["vendored-libgit2"]

modified radicle-git-types/src/reference.rs
@@ -535,7 +535,7 @@ impl<S, T> SymbolicRef<S, T> {
        let source = Into::<ext::RefLike>::into(&self.source);
        let target = Into::<ext::RefLike>::into(&self.target);

-
        let reflog_msg = &format!("creating symbolic ref {} -> {}", source, target);
+
        let reflog_msg = &format!("creating symbolic ref {source} -> {target}");
        tracing::debug!("{}", reflog_msg);

        let _ = repo.refname_to_id(target.as_str())?;
modified radicle-git-types/src/refspec.rs
@@ -62,7 +62,7 @@ where
        let src = Into::<ext::RefspecPattern>::into(&self.src);
        let dst = Into::<ext::RefspecPattern>::into(&self.dst);

-
        write!(f, "{}:{}", src, dst)
+
        write!(f, "{src}:{dst}")
    }
}

modified radicle-surf/Cargo.toml
@@ -33,7 +33,7 @@ nonempty = "0.5"
thiserror = "1.0"

[dependencies.git2]
-
version = "0.15.0"
+
version = "0.16.1"
default-features = false
features = ["vendored-libgit2"]

modified radicle-surf/build.rs
@@ -60,7 +60,7 @@ fn main() {

    unpack(git_platinum_tarball, target).expect("Failed to unpack git-platinum");

-
    println!("cargo:rerun-if-changed={}", git_platinum_tarball);
+
    println!("cargo:rerun-if-changed={git_platinum_tarball}");
}

fn unpack(archive_path: impl AsRef<Path>, target: impl AsRef<Path>) -> anyhow::Result<()> {
modified radicle-surf/examples/browsing.rs
@@ -45,7 +45,7 @@ fn main() {
    print_directory(&root, &repo, 0);

    let elapsed_millis = now.elapsed().as_millis();
-
    println!("browse with print: {} ms", elapsed_millis);
+
    println!("browse with print: {elapsed_millis} ms");
}

fn print_directory(d: &Directory, repo: &Repository, indent_level: usize) {
modified radicle-surf/examples/diff.rs
@@ -40,7 +40,7 @@ fn get_options_or_exit() -> Options {
    match Options::parse(std::env::args()) {
        Ok(options) => options,
        Err(message) => {
-
            println!("{}", message);
+
            println!("{message}");
            std::process::exit(1);
        },
    }
@@ -50,7 +50,7 @@ fn init_repository_or_exit(path_to_repo: &str) -> Repository {
    match Repository::open(path_to_repo) {
        Ok(repo) => repo,
        Err(e) => {
-
            println!("Failed to create repository: {:?}", e);
+
            println!("Failed to create repository: {e:?}");
            std::process::exit(1);
        },
    }
@@ -74,7 +74,7 @@ fn print_diff_summary(diff: &Diff, elapsed_nanos: u128) {
        diff.modified.len(),
        diff.added.len() + diff.deleted.len() + diff.modified.len()
    );
-
    println!("diff took {} nanos ", elapsed_nanos);
+
    println!("diff took {elapsed_nanos} nanos ");
}

struct Options {
modified radicle-surf/src/fs.rs
@@ -91,9 +91,7 @@ impl File {
    pub(crate) fn new(name: String, prefix: PathBuf, id: Oid) -> Self {
        debug_assert!(
            !prefix.ends_with(&name),
-
            "prefix = {:?}, name = {}",
-
            prefix,
-
            name
+
            "prefix = {prefix:?}, name = {name}",
        );
        Self { name, prefix, id }
    }
@@ -307,9 +305,7 @@ impl Directory {
    pub(crate) fn new(name: String, prefix: PathBuf, id: Oid) -> Self {
        debug_assert!(
            name.is_empty() || !prefix.ends_with(&name),
-
            "prefix = {:?}, name = {}",
-
            prefix,
-
            name
+
            "prefix = {prefix:?}, name = {name}",
        );
        Self { name, prefix, id }
    }
modified radicle-surf/t/Cargo.toml
@@ -19,7 +19,7 @@ proptest = "1"
serde_json = "1"

[dev-dependencies.git2]
-
version = "0.15.0"
+
version = "0.16.1"
default-features = false
features = ["vendored-libgit2"]