Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix leftover todo!() #17523

Merged
merged 4 commits into from
Nov 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/python/pants/engine/fs.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,10 @@ class PathGlobsAndRoot:
class DigestSubset:
"""A request to get a subset of a digest.

The digest will be traversed symlink-oblivious to match the provided globs. If you require a
symlink-aware subset, you can access the digest's entries `Get(DigestEntries, Digest, digest)`,
filter them out, and create a new digest: `Get(Digest, CreateDigest(...))`.

Example:

result = await Get(Digest, DigestSubset(original_digest, PathGlobs(["subdir1", "f.txt"]))
Expand Down
4 changes: 2 additions & 2 deletions src/rust/engine/fs/store/src/snapshot_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ pub trait SnapshotOps: Clone + Send + Sync + 'static {
.map_err(|err| format!("Error matching globs against {directory_digest:?}: {}", err))?;

let mut files = HashMap::new();
input_tree.walk(SymlinkBehavior::Aware, &mut |path, entry| match entry {
input_tree.walk(SymlinkBehavior::Oblivious, &mut |path, entry| match entry {
thejcannon marked this conversation as resolved.
Show resolved Hide resolved
directory::Entry::File(f) => {
files.insert(path.to_owned(), f.digest());
}
directory::Entry::Symlink(_) => todo!(),
directory::Entry::Symlink(_) => panic!("Unexpected symlink"),
directory::Entry::Directory(_) => (),
});

Expand Down