Skip to content

Commit

Permalink
fix: Run git auto commit hook before creating commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
qianlongzt authored and twpayne committed Feb 5, 2025
1 parent 5e05a84 commit 6325123
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/cmd/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1579,11 +1579,11 @@ func (c *Config) gitAutoCommit(cmd *cobra.Command, status *chezmoigit.Status) er
if status.Empty() {
return nil
}
commitMessage, err := c.gitCommitMessage(cmd, status)
if err != nil {
if err := c.runHookPre("git-auto-commit"); err != nil {
return err
}
if err := c.runHookPre("git-auto-commit"); err != nil {
commitMessage, err := c.gitCommitMessage(cmd, status)
if err != nil {
return err
}
if err := c.run(c.WorkingTreeAbsPath, c.Git.Command, []string{"commit", "--message", string(commitMessage)}); err != nil {
Expand Down

0 comments on commit 6325123

Please sign in to comment.