mirror of
https://seed.radicle.dev/rad:z6cFWeWpnZNHh9rUW8phgA3b5yGt.git
synced 2026-10-18 19:10:31 +08:00
Merge remote-tracking branch 'origin/nix/rust-1.66'
* origin/nix/rust-1.66: surf: missed expect from refactoring diff nix: update to rust-1.66 Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com>
This commit is contained in:
@@ -96,7 +96,7 @@ impl<'a> Qualified<'a> {
|
||||
/// Add a namespace.
|
||||
///
|
||||
/// Creates a new [`Namespaced`] by prefxing `self` with
|
||||
/// "refs/namespaces/<ns>".
|
||||
/// `refs/namespaces/<ns>`.
|
||||
pub fn with_namespace<'b>(&self, ns: Component<'b>) -> Namespaced<'a> {
|
||||
Namespaced(Cow::Owned(
|
||||
IntoIterator::into_iter([lit::Refs.into(), lit::Namespaces.into(), ns])
|
||||
|
||||
@@ -345,7 +345,7 @@ impl<'a> QualifiedPattern<'a> {
|
||||
/// Add a namespace.
|
||||
///
|
||||
/// Creates a new [`NamespacedPattern`] by prefxing `self` with
|
||||
/// "refs/namespaces/<ns>".
|
||||
/// `refs/namespaces/<ns>`.
|
||||
pub fn with_namespace<'b>(
|
||||
&self,
|
||||
ns: Component<'b>,
|
||||
|
||||
@@ -19,7 +19,7 @@ pub struct Service(pub GitService);
|
||||
/// talking to an SSH remote. The `FromStr` implementation for this type expects
|
||||
/// a string of the form:
|
||||
///
|
||||
/// <request type> /<path>
|
||||
/// `<request type> /<path>`
|
||||
///
|
||||
/// Where the request type is either `upload-pack` or `receive-pack`, the
|
||||
/// leading slash before the urn is optional, and the `path` is whatever the
|
||||
|
||||
+3
-3
@@ -29,10 +29,10 @@
|
||||
"homepage": "",
|
||||
"owner": "oxalica",
|
||||
"repo": "rust-overlay",
|
||||
"rev": "cf668f737ac986c0a89e83b6b2e3c5ddbd8cf33b",
|
||||
"sha256": "0xaswxxjkx5fjjl1c7gp27qajvpl9qsi0rmj044hhmjrrlpb6nvd",
|
||||
"rev": "7da2f6b3a0c32f661cb2864d7fbd1d7e6f0c7543",
|
||||
"sha256": "1daw246p4aimvx9h3cf034dsyimh9d2ww19v4fx45mcmlqw1mx42",
|
||||
"type": "tarball",
|
||||
"url": "https://github.com/oxalica/rust-overlay/archive/cf668f737ac986c0a89e83b6b2e3c5ddbd8cf33b.tar.gz",
|
||||
"url": "https://github.com/oxalica/rust-overlay/archive/7da2f6b3a0c32f661cb2864d7fbd1d7e6f0c7543.tar.gz",
|
||||
"url_template": "https://github.com/<owner>/<repo>/archive/<rev>.tar.gz"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -283,7 +283,7 @@ impl<N, R> Reference<N, R, One> {
|
||||
|
||||
/// Build a reference that points to:
|
||||
/// * `refs/namespaces/<namespace>/refs/heads/<name>`
|
||||
/// * `refs/namespaces/<namespace>/refs/remote/<peer_id>/heads/<name>
|
||||
/// * `refs/namespaces/<namespace>/refs/remote/<peer_id>/heads/<name>`
|
||||
pub fn head(namespace: impl Into<Option<N>>, remote: impl Into<Option<R>>, name: One) -> Self {
|
||||
Self {
|
||||
remote: remote.into(),
|
||||
@@ -295,7 +295,7 @@ impl<N, R> Reference<N, R, One> {
|
||||
|
||||
/// Build a reference that points to:
|
||||
/// * `refs/namespaces/<namespace>/refs/tags/<name>`
|
||||
/// * `refs/namespaces/<namespace>/refs/remote/<peer_id>/tags/<name>
|
||||
/// * `refs/namespaces/<namespace>/refs/remote/<peer_id>/tags/<name>`
|
||||
pub fn tag(namespace: impl Into<Option<N>>, remote: impl Into<Option<R>>, name: One) -> Self {
|
||||
Self {
|
||||
remote: remote.into(),
|
||||
@@ -390,7 +390,7 @@ impl<N, R> Reference<N, R, Many> {
|
||||
where
|
||||
Self: ToString,
|
||||
{
|
||||
ext::References::from_globs(repo, &[self.to_string()])
|
||||
ext::References::from_globs(repo, [self.to_string()])
|
||||
}
|
||||
|
||||
/// Build a reference that points to:
|
||||
|
||||
@@ -38,7 +38,7 @@ fn main() {
|
||||
return;
|
||||
},
|
||||
};
|
||||
let repo = Repository::discover(&repo_path).unwrap();
|
||||
let repo = Repository::discover(repo_path).unwrap();
|
||||
let now = Instant::now();
|
||||
let head = repo.head().unwrap();
|
||||
let root = repo.root_dir(head).unwrap();
|
||||
|
||||
@@ -129,7 +129,7 @@ impl TryFrom<git2::Patch<'_>> for Hunks<Addition> {
|
||||
}
|
||||
|
||||
impl TryFrom<git2::Patch<'_>> for Hunks<Deletion> {
|
||||
type Error = git2::Error;
|
||||
type Error = error::Deletion;
|
||||
|
||||
fn try_from(patch: git2::Patch) -> Result<Self, Self::Error> {
|
||||
let mut hunks = Vec::with_capacity(patch.num_hunks());
|
||||
@@ -140,7 +140,7 @@ impl TryFrom<git2::Patch<'_>> for Hunks<Deletion> {
|
||||
|
||||
for l in 0..hunk_lines {
|
||||
let line = patch.line_in_hunk(h, l)?;
|
||||
lines.push(Deletion::try_from(line).expect("TODO"));
|
||||
lines.push(Deletion::try_from(line)?);
|
||||
}
|
||||
hunks.push(Hunk { header, lines })
|
||||
}
|
||||
|
||||
@@ -16,7 +16,7 @@ mod directory {
|
||||
#[test]
|
||||
fn directory_find_entry() {
|
||||
let repo = Repository::open(GIT_PLATINUM).unwrap();
|
||||
let root = repo.root_dir(&Branch::local(refname!("master"))).unwrap();
|
||||
let root = repo.root_dir(Branch::local(refname!("master"))).unwrap();
|
||||
|
||||
// find_entry for a file.
|
||||
let path = Path::new("src/memory.rs");
|
||||
@@ -95,7 +95,7 @@ mod directory {
|
||||
#[test]
|
||||
fn directory_size() {
|
||||
let repo = Repository::open(GIT_PLATINUM).unwrap();
|
||||
let root = repo.root_dir(&Branch::local(refname!("master"))).unwrap();
|
||||
let root = repo.root_dir(Branch::local(refname!("master"))).unwrap();
|
||||
|
||||
/*
|
||||
git-platinum (master) $ ls -l src
|
||||
|
||||
@@ -12,7 +12,7 @@ use super::GIT_PLATINUM;
|
||||
fn iterate_root_dir_recursive() {
|
||||
let repo = Repository::open(GIT_PLATINUM).unwrap();
|
||||
|
||||
let root_dir = repo.root_dir(&Branch::local(refname!("master"))).unwrap();
|
||||
let root_dir = repo.root_dir(Branch::local(refname!("master"))).unwrap();
|
||||
let count = println_dir(&root_dir, &repo);
|
||||
|
||||
assert_eq!(count, 36); // Check total file count.
|
||||
@@ -42,7 +42,7 @@ fn iterate_root_dir_recursive() {
|
||||
fn browse_repo_lazily() {
|
||||
let repo = Repository::open(GIT_PLATINUM).unwrap();
|
||||
|
||||
let root_dir = repo.root_dir(&Branch::local(refname!("master"))).unwrap();
|
||||
let root_dir = repo.root_dir(Branch::local(refname!("master"))).unwrap();
|
||||
let count = root_dir.entries(&repo).unwrap().entries().count();
|
||||
assert_eq!(count, 8);
|
||||
let count = traverse(&root_dir, &repo);
|
||||
|
||||
@@ -116,8 +116,8 @@ fn test_diff() -> Result<(), Error> {
|
||||
fn test_branch_diff() -> Result<(), Error> {
|
||||
let repo = Repository::open(GIT_PLATINUM)?;
|
||||
let diff = repo.diff(
|
||||
&Branch::local(refname!("master")),
|
||||
&Branch::local(refname!("dev")),
|
||||
Branch::local(refname!("master")),
|
||||
Branch::local(refname!("dev")),
|
||||
)?;
|
||||
|
||||
println!("Diff two branches: master -> dev");
|
||||
|
||||
@@ -103,7 +103,7 @@ fn root() {
|
||||
.expect("Could not retrieve ./data/git-platinum as git repository");
|
||||
let rev = Branch::local(refname!("master"));
|
||||
let root_last_commit_id = repo
|
||||
.last_commit(&PathBuf::new(), &rev)
|
||||
.last_commit(PathBuf::new(), rev)
|
||||
.expect("Failed to get last commit")
|
||||
.map(|commit| commit.id);
|
||||
|
||||
|
||||
@@ -6,5 +6,5 @@ fn test_submodule_failure() {
|
||||
use radicle_surf::git::{Branch, Repository};
|
||||
|
||||
let repo = Repository::discover(".").unwrap();
|
||||
repo.root_dir(&Branch::local(refname!("main"))).unwrap();
|
||||
repo.root_dir(Branch::local(refname!("main"))).unwrap();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user