You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Set +x in index in gix-worktree-stream basic fixture, adjust test
As in 470c76e, this updates tests to reflect the ability of Git
repositories to represent Unix-style executable permissions in an
index and commits, and the ability of gitoxide to operate on this,
on all platforms, including Windows where the filesystem itself
does not support this kind of executable permissons. Changes:
1. Adds a `git update-index --chmod=+x` command in the basic.sh
fixture for gix-worktree-steam, so `dir/subtree/exe` is marked
executable in the repository, even on Windows where the
filesystem itself does not support Unix-style executable
permissions and where, in Git Bash, `chmod +x` has no effect.
This does not affect `extra-exe`, which is never staged. Since
`extra-exe` is just an extra file in the working tree, it cannot
be marked `+x` on Windows.
2. Updates the `paths_and_modes` assertion in
`will_provide_all_information_and_respect_export_ignore` to
assert the correct mode, with `+x` set, in the staged/committed
file `dir/subtree/exe`.
The `extra-exe` part of the assertion is unchanged in meaning,
but the `expected_exe_mode` would only be used in that one
place now, so this removes it and replaces it with the
conditional expression for its value based on whether we are
using Windows. While doing that refactoring, this also removes
the `expected_link_mode` constant, which has unconditionally
aliased `EntryKind::Link` since 93e088a (GitoxideLabs#1444).
These changes are directly analogous to (1) and (2) in 470c76e.
Here, they are made to the gix-worktree-stream tests, while in
470c76e they were made to the gix-archive tests (along with another
related change, in (3), for which there is nothing anlogous to be
done here).
For reference, with *this* commit's change (1) described above but
without *this* commit's change (2), the failure is:
--- STDERR: gix-worktree-stream::stream from_tree::will_provide_all_information_and_respect_export_ignore ---
Finished `dev` profile [unoptimized + debuginfo] target(s) in 0.45s
thread 'from_tree::will_provide_all_information_and_respect_export_ignore' panicked at gix-worktree-stream\tests\stream.rs:119:9:
assertion `left == right` failed
left: [(".gitattributes", Blob, Sha1(45c160c35c17ad264b96431cceb9793160396e99)), ("a", Blob, Sha1(45b983be36b73c0788dc9cbcb76cbb80fc7bb057)), ("bigfile", Blob, Sha1(4995fde49ed64e043977e22539f66a0d372dd129)), ("symlink-to-a", Link, Sha1(2e65efe2a145dda7ee51d1741299f848e5bf752e)), ("dir/.gitattributes", Blob, Sha1(81b9a375276405703e05be6cecf0fc1c8b8eed64)), ("dir/b", Blob, Sha1(ab4a98190cf776b43cb0fe57cef231fb93fd07e6)), ("dir/subdir/exe", BlobExecutable, Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)), ("dir/subdir/streamed", Blob, Sha1(08991f58f4de5d85b61c0f87f3ac053c79d0e739)), ("extra-file", Blob, Sha1(0000000000000000000000000000000000000000)), ("extra-bigfile", Blob, Sha1(0000000000000000000000000000000000000000)), ("extra-exe", Blob, Sha1(0000000000000000000000000000000000000000)), ("extra-dir-empty", Tree, Sha1(0000000000000000000000000000000000000000)), ("extra-dir/symlink-to-extra", Link, Sha1(0000000000000000000000000000000000000000))]
right: [(".gitattributes", Blob, Sha1(45c160c35c17ad264b96431cceb9793160396e99)), ("a", Blob, Sha1(45b983be36b73c0788dc9cbcb76cbb80fc7bb057)), ("bigfile", Blob, Sha1(4995fde49ed64e043977e22539f66a0d372dd129)), ("symlink-to-a", Link, Sha1(2e65efe2a145dda7ee51d1741299f848e5bf752e)), ("dir/.gitattributes", Blob, Sha1(81b9a375276405703e05be6cecf0fc1c8b8eed64)), ("dir/b", Blob, Sha1(ab4a98190cf776b43cb0fe57cef231fb93fd07e6)), ("dir/subdir/exe", Blob, Sha1(e69de29bb2d1d6434b8b29ae775ad8c2e48c5391)), ("dir/subdir/streamed", Blob, Sha1(08991f58f4de5d85b61c0f87f3ac053c79d0e739)), ("extra-file", Blob, Sha1(0000000000000000000000000000000000000000)), ("extra-bigfile", Blob, Sha1(0000000000000000000000000000000000000000)), ("extra-exe", Blob, Sha1(0000000000000000000000000000000000000000)), ("extra-dir-empty", Tree, Sha1(0000000000000000000000000000000000000000)), ("extra-dir/symlink-to-extra", Link, Sha1(0000000000000000000000000000000000000000))]
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
0 commit comments