@@ -86,7 +86,7 @@ func (self *WorkingTreeHelper) OpenMergeTool() error {
86
86
return nil
87
87
}
88
88
89
- func (self * WorkingTreeHelper ) HandleCommitPressWithMessage (initialMessage string ) error {
89
+ func (self * WorkingTreeHelper ) HandleCommitPressWithMessage (initialMessage string , forceSkipHooks bool ) error {
90
90
return self .WithEnsureCommittableFiles (func () error {
91
91
self .commitsHelper .OpenCommitMessagePanel (
92
92
& OpenCommitMessagePanelOpts {
@@ -95,25 +95,29 @@ func (self *WorkingTreeHelper) HandleCommitPressWithMessage(initialMessage strin
95
95
SummaryTitle : self .c .Tr .CommitSummaryTitle ,
96
96
DescriptionTitle : self .c .Tr .CommitDescriptionTitle ,
97
97
PreserveMessage : true ,
98
- OnConfirm : self .handleCommit ,
99
- OnSwitchToEditor : self .switchFromCommitMessagePanelToEditor ,
98
+ OnConfirm : func (summary string , description string ) error {
99
+ return self .handleCommit (summary , description , forceSkipHooks )
100
+ },
101
+ OnSwitchToEditor : func (filepath string ) error {
102
+ return self .switchFromCommitMessagePanelToEditor (filepath , forceSkipHooks )
103
+ },
100
104
},
101
105
)
102
106
103
107
return nil
104
108
})
105
109
}
106
110
107
- func (self * WorkingTreeHelper ) handleCommit (summary string , description string ) error {
108
- cmdObj := self .c .Git ().Commit .CommitCmdObj (summary , description )
111
+ func (self * WorkingTreeHelper ) handleCommit (summary string , description string , forceSkipHooks bool ) error {
112
+ cmdObj := self .c .Git ().Commit .CommitCmdObj (summary , description , forceSkipHooks )
109
113
self .c .LogAction (self .c .Tr .Actions .Commit )
110
114
return self .gpgHelper .WithGpgHandling (cmdObj , self .c .Tr .CommittingStatus , func () error {
111
115
self .commitsHelper .OnCommitSuccess ()
112
116
return nil
113
117
})
114
118
}
115
119
116
- func (self * WorkingTreeHelper ) switchFromCommitMessagePanelToEditor (filepath string ) error {
120
+ func (self * WorkingTreeHelper ) switchFromCommitMessagePanelToEditor (filepath string , forceSkipHooks bool ) error {
117
121
// We won't be able to tell whether the commit was successful, because
118
122
// RunSubprocessAndRefresh doesn't return the error (it opens an error alert
119
123
// itself and returns nil on error). But even if we could, we wouldn't have
@@ -124,7 +128,7 @@ func (self *WorkingTreeHelper) switchFromCommitMessagePanelToEditor(filepath str
124
128
125
129
self .c .LogAction (self .c .Tr .Actions .Commit )
126
130
return self .c .RunSubprocessAndRefresh (
127
- self .c .Git ().Commit .CommitInEditorWithMessageFileCmdObj (filepath ),
131
+ self .c .Git ().Commit .CommitInEditorWithMessageFileCmdObj (filepath , forceSkipHooks ),
128
132
)
129
133
}
130
134
@@ -140,12 +144,7 @@ func (self *WorkingTreeHelper) HandleCommitEditorPress() error {
140
144
}
141
145
142
146
func (self * WorkingTreeHelper ) HandleWIPCommitPress () error {
143
- skipHookPrefix := self .c .UserConfig ().Git .SkipHookPrefix
144
- if skipHookPrefix == "" {
145
- return errors .New (self .c .Tr .SkipHookPrefixNotConfigured )
146
- }
147
-
148
- return self .HandleCommitPressWithMessage (skipHookPrefix )
147
+ return self .HandleCommitPressWithMessage ("" , true )
149
148
}
150
149
151
150
func (self * WorkingTreeHelper ) HandleCommitPress () error {
@@ -173,7 +172,7 @@ func (self *WorkingTreeHelper) HandleCommitPress() error {
173
172
}
174
173
}
175
174
176
- return self .HandleCommitPressWithMessage (message )
175
+ return self .HandleCommitPressWithMessage (message , false )
177
176
}
178
177
179
178
func (self * WorkingTreeHelper ) WithEnsureCommittableFiles (handler func () error ) error {
0 commit comments