Skip to content

Commit 6b4a303

Browse files
committed
Merge branch 'dev-on-linux'
2 parents e145a74 + 59f21e4 commit 6b4a303

File tree

107 files changed

+87
-42
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+87
-42
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ jobs:
5252
- name: test
5353
env:
5454
CI: true
55+
GITOXIDE_TEST_IGNORE_ARCHIVES: 1
5556
run: just ci-test
5657

5758
test-fast:
@@ -60,6 +61,7 @@ jobs:
6061
os:
6162
- windows-latest
6263
- macos-latest
64+
- ubuntu-latest
6365
runs-on: ${{ matrix.os }}
6466
steps:
6567
- uses: actions/checkout@v3

gix-archive/tests/archive.rs

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ mod from_tree {
1818
#[test]
1919
fn basic_usage_internal() -> gix_testtools::Result {
2020
basic_usage(gix_archive::Format::InternalTransientNonPersistable, |buf| {
21-
assert_eq!(buf.len(), 551);
21+
assert_eq!(buf.len(), if cfg!(windows) { 565 } else { 551 });
2222

2323
let mut stream = gix_worktree_stream::Stream::from_read(std::io::Cursor::new(buf));
2424
let mut paths_and_modes = Vec::new();
@@ -28,7 +28,12 @@ mod from_tree {
2828
entry.read_to_end(&mut buf).expect("stream can always be read");
2929
}
3030

31-
let expected_extra_exe_mode = if cfg!(windows) {
31+
let expected_link_mode = if cfg!(windows) {
32+
EntryMode::Blob
33+
} else {
34+
EntryMode::Link
35+
};
36+
let expected_exe_mode = if cfg!(windows) {
3237
EntryMode::Blob
3338
} else {
3439
EntryMode::BlobExecutable
@@ -48,8 +53,12 @@ mod from_tree {
4853
),
4954
(
5055
"symlink-to-a".into(),
51-
EntryMode::Link,
52-
hex_to_id("2e65efe2a145dda7ee51d1741299f848e5bf752e")
56+
expected_link_mode,
57+
hex_to_id(if cfg!(windows) {
58+
"45b983be36b73c0788dc9cbcb76cbb80fc7bb057"
59+
} else {
60+
"2e65efe2a145dda7ee51d1741299f848e5bf752e"
61+
})
5362
),
5463
(
5564
"dir/b".into(),
@@ -58,7 +67,7 @@ mod from_tree {
5867
),
5968
(
6069
"dir/subdir/exe".into(),
61-
EntryMode::BlobExecutable,
70+
expected_exe_mode,
6271
hex_to_id("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391")
6372
),
6473
(
@@ -68,7 +77,7 @@ mod from_tree {
6877
),
6978
(
7079
"extra-exe".into(),
71-
expected_extra_exe_mode,
80+
expected_exe_mode,
7281
hex_to_id("0000000000000000000000000000000000000000")
7382
),
7483
(
@@ -78,7 +87,7 @@ mod from_tree {
7887
),
7988
(
8089
"extra-dir/symlink-to-extra".into(),
81-
EntryMode::Link,
90+
expected_link_mode,
8291
hex_to_id("0000000000000000000000000000000000000000")
8392
)
8493
]
@@ -111,19 +120,34 @@ mod from_tree {
111120
header.mode()?,
112121
));
113122
}
114-
let expected_extra_exe_mode = if cfg!(windows) { 420 } else { 493 };
123+
let expected_symlink_type = if cfg!(windows) {
124+
EntryType::Regular
125+
} else {
126+
EntryType::Symlink
127+
};
128+
let expected_exe_mode = if cfg!(windows) { 420 } else { 493 };
115129
assert_eq!(
116130
out,
117131
[
118132
("prefix/.gitattributes", EntryType::Regular, 56, 420),
119133
("prefix/a", EntryType::Regular, 3, 420),
120-
("prefix/symlink-to-a", EntryType::Symlink, 0, 420),
134+
(
135+
"prefix/symlink-to-a",
136+
expected_symlink_type,
137+
if cfg!(windows) { 3 } else { 0 },
138+
420
139+
),
121140
("prefix/dir/b", EntryType::Regular, 3, 420),
122-
("prefix/dir/subdir/exe", EntryType::Regular, 0, 493),
141+
("prefix/dir/subdir/exe", EntryType::Regular, 0, expected_exe_mode),
123142
("prefix/extra-file", EntryType::Regular, 21, 420),
124-
("prefix/extra-exe", EntryType::Regular, 0, expected_extra_exe_mode),
143+
("prefix/extra-exe", EntryType::Regular, 0, expected_exe_mode),
125144
("prefix/extra-dir-empty", EntryType::Directory, 0, 420),
126-
("prefix/extra-dir/symlink-to-extra", EntryType::Symlink, 0, 420)
145+
(
146+
"prefix/extra-dir/symlink-to-extra",
147+
expected_symlink_type,
148+
if cfg!(windows) { 21 } else { 0 },
149+
420
150+
)
127151
]
128152
.into_iter()
129153
.map(|(path, b, c, d)| (bstr::BStr::new(path).to_owned(), b, c, d))
@@ -155,8 +179,8 @@ mod from_tree {
155179
},
156180
|buf| {
157181
assert!(
158-
buf.len() < 1200,
159-
"bigger than uncompressed for some reason: {} < 1200",
182+
buf.len() < 1220,
183+
"bigger than uncompressed for some reason: {} < 1220",
160184
buf.len()
161185
);
162186
let mut ar = zip::ZipArchive::new(std::io::Cursor::new(buf.as_slice()))?;
@@ -181,10 +205,14 @@ mod from_tree {
181205
let mut link = ar.by_name("prefix/symlink-to-a")?;
182206
assert!(!link.is_dir());
183207
assert!(link.is_file(), "no symlink differentiation");
184-
assert_eq!(link.unix_mode(), Some(0o120644), "it's all in the mode");
208+
assert_eq!(
209+
link.unix_mode(),
210+
Some(if cfg!(windows) { 0o100644 } else { 0o120644 }),
211+
"the mode specifies what it should be"
212+
);
185213
let mut buf = Vec::new();
186214
link.read_to_end(&mut buf)?;
187-
assert_eq!(buf.as_bstr(), "a");
215+
assert_eq!(buf.as_bstr(), if cfg!(windows) { "hi\n" } else { "a" });
188216
Ok(())
189217
},
190218
)

gix-archive/tests/fixtures/basic.sh

100644100755
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#!/bin/bash
12
set -eu -o pipefail
23

34
git init
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
basic.tar.xz

gix-archive/tests/fixtures/generated-archives/basic.tar.xz

Lines changed: 0 additions & 3 deletions
This file was deleted.

gix-attributes/tests/fixtures/make_attributes_baseline.sh

100644100755
File mode changed.

gix-command/tests/command.rs

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,17 +31,15 @@ mod spawn {
3131
#[test]
3232
#[cfg(unix)]
3333
fn disallow_shell() -> crate::Result {
34-
let out = gix_command::prepare("echo hi")
34+
let out = gix_command::prepare("PATH= echo hi")
3535
.with_shell()
3636
.spawn()?
3737
.wait_with_output()?;
3838
assert_eq!(out.stdout.as_bstr(), "hi\n");
39+
40+
let mut cmd: std::process::Command = gix_command::prepare("echo hi").with_shell().without_shell().into();
3941
assert!(
40-
gix_command::prepare("echo hi")
41-
.with_shell()
42-
.without_shell()
43-
.spawn()
44-
.is_err(),
42+
cmd.env_remove("PATH").spawn().is_err(),
4543
"no command named 'echo hi' exists"
4644
);
4745
Ok(())

gix-commitgraph/tests/fixtures/generation_number_overflow.sh

100644100755
File mode changed.

gix-commitgraph/tests/fixtures/single_commit_huge_dates.sh

100644100755
File mode changed.

gix-config/tests/fixtures/config_with_worktree_extension.sh

100644100755
File mode changed.

0 commit comments

Comments
 (0)