Skip to content

Commit 6e5b52d

Browse files
committed
feat: filter::Pipeline::worktree_file_to_object() now can add Commit type objects.
1 parent 70ebd5f commit 6e5b52d

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
#!/usr/bin/env bash
22
set -eu -o pipefail
33

4+
git init embedded-repository
5+
(cd embedded-repository
6+
echo content >file && git add file && git commit -m "init"
7+
)
8+
49
git init -q
510
echo content >file
611
ln -s file link
712

813
echo binary >exe && chmod +x exe
914
mkfifo fifo
15+
16+
git submodule add ./embedded-repository submodule

gix/tests/gix/repository/filter.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ fn pipeline_worktree_file_to_object() -> crate::Result {
4040
t.map(|t| (t.0, t.1))
4141
}
4242

43+
let submodule_id = hex_to_id("a047f8183ba2bb7eb00ef89e60050c5fde740483");
44+
assert_eq!(
45+
take_two(pipe.worktree_file_to_object("embedded-repository".into(), &index)?),
46+
Some((submodule_id, gix::object::tree::EntryKind::Commit))
47+
);
48+
assert_eq!(
49+
take_two(pipe.worktree_file_to_object("submodule".into(), &index)?),
50+
Some((submodule_id, gix::object::tree::EntryKind::Commit))
51+
);
4352
assert_eq!(
4453
take_two(pipe.worktree_file_to_object("file".into(), &index)?),
4554
Some((

0 commit comments

Comments
 (0)