sds / overcommit

A fully configurable and extendable Git hook manager
MIT License
3.91k stars 280 forks source link

Unable to setup environment for pre-commit hook run: unknown switch #847

Open jerrygar96 opened 5 months ago

jerrygar96 commented 5 months ago

Hooks fail when trying to stash changes with message

Unable to setup environment for pre-commit hook run
STDOUT:
STDERR:error: unknown switch `0'
usage: git stash save [-p | --patch] [-S | --staged]...
stash message

in stash_changes in file stash_unstaged_changes.rb changing stash_message to use Time.now.to_i instead of Time.now seems to fix the issue for me.

This issue only presents itself when not committing all changed files.