Skip to content

Commit

Permalink
feat: filter::Pipeline::worktree_file_to_object() now can add `Comm…
Browse files Browse the repository at this point in the history
…it` type objects.
  • Loading branch information
Byron committed Feb 7, 2025
1 parent 70ebd5f commit 6e5b52d
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gix/tests/fixtures/repo_with_untracked_files.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
#!/usr/bin/env bash
set -eu -o pipefail

git init embedded-repository
(cd embedded-repository
echo content >file && git add file && git commit -m "init"
)

git init -q
echo content >file
ln -s file link

echo binary >exe && chmod +x exe
mkfifo fifo

git submodule add ./embedded-repository submodule
9 changes: 9 additions & 0 deletions gix/tests/gix/repository/filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,15 @@ fn pipeline_worktree_file_to_object() -> crate::Result {
t.map(|t| (t.0, t.1))
}

let submodule_id = hex_to_id("a047f8183ba2bb7eb00ef89e60050c5fde740483");
assert_eq!(
take_two(pipe.worktree_file_to_object("embedded-repository".into(), &index)?),
Some((submodule_id, gix::object::tree::EntryKind::Commit))
);
assert_eq!(
take_two(pipe.worktree_file_to_object("submodule".into(), &index)?),
Some((submodule_id, gix::object::tree::EntryKind::Commit))
);
assert_eq!(
take_two(pipe.worktree_file_to_object("file".into(), &index)?),
Some((
Expand Down

0 comments on commit 6e5b52d

Please sign in to comment.