Skip to content

Commit

Permalink
Merge pull request #2765 from cgwalters/drop-openat
Browse files Browse the repository at this point in the history
rust: Drop `openat` dependency
  • Loading branch information
jmarrero committed Nov 13, 2022
2 parents ba39acf + 8d08e56 commit 0dbd87c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ thiserror = "1.0.20"

[dev-dependencies]
maplit = "1.0.2"
openat = "0.1.19"
tempfile = "3"
cap-tempfile = "1.0"

Expand Down
18 changes: 10 additions & 8 deletions rust-bindings/tests/repo/checkout_at.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
use crate::util::*;
use cap_std::fs::Dir;
use cap_tempfile::cap_std;
use ostree::*;
use std::os::unix::io::AsRawFd;

Expand All @@ -8,12 +10,12 @@ fn should_checkout_at_with_none_options() {
let checksum = test_repo.test_commit("test");
let checkout_dir = tempfile::tempdir().expect("checkout dir");

let dirfd = openat::Dir::open(checkout_dir.path()).expect("openat");
let dir = Dir::open_ambient_dir(checkout_dir.path(), cap_std::ambient_authority()).unwrap();
test_repo
.repo
.checkout_at(
None,
dirfd.as_raw_fd(),
dir.as_raw_fd(),
"test-checkout",
&checksum,
gio::Cancellable::NONE,
Expand All @@ -29,12 +31,12 @@ fn should_checkout_at_with_default_options() {
let checksum = test_repo.test_commit("test");
let checkout_dir = tempfile::tempdir().expect("checkout dir");

let dirfd = openat::Dir::open(checkout_dir.path()).expect("openat");
let dir = Dir::open_ambient_dir(checkout_dir.path(), cap_std::ambient_authority()).unwrap();
test_repo
.repo
.checkout_at(
Some(&RepoCheckoutAtOptions::default()),
dirfd.as_raw_fd(),
dir.as_raw_fd(),
"test-checkout",
&checksum,
gio::Cancellable::NONE,
Expand All @@ -50,7 +52,7 @@ fn should_checkout_at_with_options() {
let checksum = test_repo.test_commit("test");
let checkout_dir = tempfile::tempdir().expect("checkout dir");

let dirfd = openat::Dir::open(checkout_dir.path()).expect("openat");
let dir = Dir::open_ambient_dir(checkout_dir.path(), cap_std::ambient_authority()).unwrap();
test_repo
.repo
.checkout_at(
Expand All @@ -61,7 +63,7 @@ fn should_checkout_at_with_options() {
devino_to_csum_cache: Some(RepoDevInoCache::new()),
..Default::default()
}),
dirfd.as_raw_fd(),
dir.as_raw_fd(),
"test-checkout",
&checksum,
gio::Cancellable::NONE,
Expand All @@ -80,7 +82,7 @@ fn should_checkout_at_with_filter() {
let checksum = test_repo.test_commit("test");
let checkout_dir = tempfile::tempdir().expect("checkout dir");

let dirfd = openat::Dir::open(checkout_dir.path()).expect("openat");
let dir = Dir::open_ambient_dir(checkout_dir.path(), cap_std::ambient_authority()).unwrap();
test_repo
.repo
.checkout_at(
Expand All @@ -94,7 +96,7 @@ fn should_checkout_at_with_filter() {
}),
..Default::default()
}),
dirfd.as_raw_fd(),
dir.as_raw_fd(),
"test-checkout",
&checksum,
gio::Cancellable::NONE,
Expand Down

0 comments on commit 0dbd87c

Please sign in to comment.