Skip to content

Commit d28591b

Browse files
committed
build git repository from parts (#16)
1 parent 7e85688 commit d28591b

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ default-features = false
2424
features = ["https"]
2525

2626
[dev-dependencies]
27-
git-testtools = "0.7.1"
27+
git-testtools = "0.8.0"
2828
tempdir = "0.3.5"
2929
serial_test = "0.6.0"

tests/fixtures/make-index-from-parts.sh

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
set -eu -o pipefail
44

5-
parts="tests/fixtures/index-parts"
5+
parts="${1:?first argument is the repoitory root}/tests/fixtures/index-parts"
66
commit_list=$parts/commit.list
77

88
git init
9-
tar -x $parts/init.*.tar
9+
tar -x < $parts/init.*.tar
1010
git add . && git commit -m "initial commit"
1111

1212

1313
while read -r commit; do
1414
patch -p1 < "$parts/$commit.diff"
15+
git add .
1516
git commit -F "$parts/$commit.msg"
16-
done < "$commit_list"
17+
done < "$commit_list"
18+
git gc

tests/index/mod.rs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,18 @@ mod changes_from_objects {
55
use crate::index::index_ro;
66

77
#[test]
8-
#[ignore]
98
fn addition() {
109
let _index = index_ro();
1110
}
1211
}
1312

1413
fn index_ro() -> Index {
15-
let dir = git_testtools::scripted_fixture_repo_read_only("make-index-from-parts.sh").unwrap();
14+
let dir = git_testtools::scripted_fixture_repo_read_only_with_args(
15+
"make-index-from-parts.sh",
16+
std::env::current_dir()
17+
.ok()
18+
.map(|p| p.to_str().unwrap().to_owned()),
19+
)
20+
.unwrap();
1621
Index::from_path_or_cloned(dir).unwrap()
1722
}

0 commit comments

Comments
 (0)