1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-05 00:59:19 +02:00

Commit without pre-commit hooks is independent on prefix

Add verify flag

Add and update integration tests

Rename verify to forceSkipHooks

Adapt CommitSkipHooks integration test to actually use a hook

Remove forceSkipHooks param from OnConfirm et al

Simplify tests
This commit is contained in:
Korbinian Schweiger
2025-03-05 20:41:29 +01:00
committed by Stefan Haller
parent ab9f4af636
commit b102646b20
12 changed files with 254 additions and 33 deletions

View File

@ -72,3 +72,38 @@ func checkCommitContainsChange(t *TestDriver, commitSubject string, change strin
t.Views().Main().
Content(Contains(change))
}
func checkBlockingHook(t *TestDriver, keys config.KeybindingConfig) {
// Shared function for tests using the blockingHook pre-commit hook for testing hook skipping
// Stage first file
t.Views().Files().
IsFocused().
PressPrimaryAction().
Press(keys.Files.CommitChanges)
// Try to commit with hook
t.ExpectPopup().CommitMessagePanel().
Title(Equals("Commit summary")).
Type("Commit should fail").
Confirm()
t.ExpectPopup().Alert().
Title(Equals("Error")).
Content(Contains("Git command failed.")).
Confirm()
// Clear the message
t.Views().Files().
IsFocused().
Press(keys.Files.CommitChanges)
t.ExpectPopup().CommitMessagePanel().
Title(Equals("Commit summary")).
Clear().
Cancel()
// Unstage the file
t.Views().Files().
IsFocused().
PressPrimaryAction()
}