Repository navigation
Commit 836b32a
committed
fix(check): support first pushes in the 'commitizen-branch' hook
Details: When a push includes the root commit (first push to an empty
remote, or a new unrelated history), pre-commit does not set
'PRE_COMMIT_FROM_REF' and 'PRE_COMMIT_TO_REF'. The
'commitizen-branch' hook then fails with:
> fatal: ambiguous argument '$PRE_COMMIT_FROM_REF..$PRE_COMMIT_TO_REF'
In this case, check all commits of 'PRE_COMMIT_LOCAL_BRANCH',
since they are all new to the remote.
---
Signed-off-by: Adrian DC <radian.dc@gmail.com>1 parent 16a1b9e commit 836b32a
2 files changed
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
45 | 52 | | |
46 | 53 | | |
47 | 54 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
204 | 204 | | |
205 | 205 | | |
206 | 206 | | |
| 207 | + | |
207 | 208 | | |
208 | 209 | | |
209 | 210 | | |
| |||
219 | 220 | | |
220 | 221 | | |
221 | 222 | | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
222 | 243 | | |
223 | 244 | | |
224 | 245 | | |
| |||
0 commit comments