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
Describe the bug
Commit hooks don't work on Windows with wsl2 installed.
run cargo test -p asyncgit sync::hooks::tests::test_commit_msg_no_block_but_alter
[2023-01-29T07:41:54Z TRACE asyncgit::sync::hooks] run hook '"C:/Users/hamflx/AppData/Local/Temp/.tmp4nwh43/.git/hooks/commit-msg"' in '"C:/Users/hamflx/AppData/Local/Temp/.tmp4nwh43/"'
thread 'sync::hooks::tests::test_commit_msg_no_block_but_alter' panicked at 'assertion failed: `(left == right)`
left: `NotOk("/bin/bash: line 1: C:/Users/hamflx/AppData/Local/Temp/.tmp4nwh43/.git/hooks/commit-msg: No such file or directory\n")`,
right: `Ok`', asyncgit\src\sync\hooks.rs:493:9
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
It looks like gitui is using wsl's bash:
C:\>where bash
C:\Windows\System32\bash.exe
C:\> bash -c D:/tmp/echo_some_thing.sh
/bin/bash: line 1: D:/tmp/echo_some_thing.sh: No such file or directory
C:\>"C:\Program Files\Git\usr\bin\bash.exe" -c D:/tmp/echo_some_thing.sh
some thing
To Reproduce
run cargo test -p asyncgit sync::hooks::tests::test_commit_msg_no_block_but_alter on Windows(with WSL2 installed, and git bash not in PATH).
Expected behavior
unit test works.
Screenshots
Context (please complete the following information):
OS/Distro + Version: Windows 10 22H2 19045.2364
GitUI Version 0.22.1
Rust version: 1.66.1
Additional context
The text was updated successfully, but these errors were encountered:
I'm trying to find git.exe, and using that to find bash.exe: hamflx@6480c01
For example, git.exe is located at C:\Program Files\Git\cmd\git.exe, then I remove cmd\git.exe from the path and add usr\bin\bash.exe, finally we get C:\Program Files\Git\usr\bin\bash. exe.
If this way is acceptable, I will make a pr.
hamflx
changed the title
Commit hooks don't work with wsl2 on Windows.
Commit hooks don't work on Windows with wsl2 installed.
Jan 29, 2023
Describe the bug
Commit hooks don't work on Windows with wsl2 installed.
run
cargo test -p asyncgit sync::hooks::tests::test_commit_msg_no_block_but_alter
It looks like gitui is using wsl's bash:
To Reproduce
run
cargo test -p asyncgit sync::hooks::tests::test_commit_msg_no_block_but_alter
on Windows(with WSL2 installed, and git bash not in PATH).Expected behavior
unit test works.
Screenshots
Context (please complete the following information):
Additional context
The text was updated successfully, but these errors were encountered: