Skip to content

Commit 7f7d148

Browse files
committed
show that ref-tables aren't currently supported.
1 parent 51e260f commit 7f7d148

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed
Binary file not shown.
+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
set -eu -o pipefail
3+
4+
git init -q
5+
6+
git checkout -b main
7+
touch this
8+
git add this
9+
git commit -q -m c1
10+
echo hello >> this
11+
git commit -q -am c2
12+
13+
git clone --ref-format=reftable . reftable-clone

gix/tests/gix/repository/open.rs

+24
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,30 @@ fn on_root_with_decomposed_unicode() -> crate::Result {
5555
Ok(())
5656
}
5757

58+
#[test]
59+
fn non_bare_reftable() -> crate::Result {
60+
let repo = match named_subrepo_opts(
61+
"make_reftable_repo.sh",
62+
"reftable-clone",
63+
gix::open::Options::isolated(),
64+
) {
65+
Ok(r) => r,
66+
Err(err) if err.to_string().contains("unknown option `ref-format=reftable'") => return Ok(()),
67+
Err(err) => panic!("{err}"),
68+
};
69+
assert!(
70+
repo.head_id().is_err(),
71+
"Trying to do anything with head will fail as we don't support reftables yet"
72+
);
73+
assert!(!repo.is_bare());
74+
assert_ne!(
75+
repo.workdir(),
76+
None,
77+
"Otherwise it can be used, but it's hard to do without refs"
78+
);
79+
Ok(())
80+
}
81+
5882
#[test]
5983
fn bare_repo_with_index() -> crate::Result {
6084
let repo = named_subrepo_opts(

0 commit comments

Comments
 (0)