Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 8200ad1

Browse files
possible fix to test_hook_uses_shell_not_from_cwd
1 parent 0c14cac commit 8200ad1

File tree

1 file changed

+13
-13
lines changed

1 file changed

+13
-13
lines changed

‎test/test_index.py‎

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,19 +1064,19 @@ def test_hook_uses_shell_not_from_cwd(self, rw_dir, case):
10641064
shutil.copy(fixture_path("polyglot"), hook_path("polyglot", repo.git_dir))
10651065
payload = Path(rw_dir, "payload.txt")
10661066

1067-
if type(_win_bash_status) in {WinBashStatus.Absent, WinBashStatus.WslNoDistro}:
1068-
# The real shell can't run, but the impostor should still not be used.
1069-
with self.assertRaises(HookExecutionError):
1070-
with maybe_chdir:
1071-
run_commit_hook("polyglot", repo.index)
1072-
self.assertFalse(payload.exists())
1073-
else:
1074-
# The real shell should run, and not the impostor.
1075-
with maybe_chdir:
1076-
run_commit_hook("polyglot", repo.index)
1077-
self.assertFalse(payload.exists())
1078-
output = Path(rw_dir, "output.txt").read_text(encoding="utf-8")
1079-
self.assertEqual(output, "Ran intended hook.\n")
1067+
# if type(_win_bash_status) in {WinBashStatus.Absent, WinBashStatus.WslNoDistro}:
1068+
# # The real shell can't run, but the impostor should still not be used.
1069+
# with self.assertRaises(HookExecutionError):
1070+
# with maybe_chdir:
1071+
# run_commit_hook("polyglot", repo.index)
1072+
# self.assertFalse(payload.exists())
1073+
# else:
1074+
# The real shell should run, and not the impostor.
1075+
with maybe_chdir:
1076+
run_commit_hook("polyglot", repo.index)
1077+
self.assertFalse(payload.exists())
1078+
output = Path(rw_dir, "output.txt").read_text(encoding="utf-8")
1079+
self.assertEqual(output, "Ran intended hook.\n")
10801080

10811081
# @pytest.mark.xfail(
10821082
# type(_win_bash_status) is WinBashStatus.Absent,

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /