Commit Graph

11 Commits

Author SHA1 Message Date
Wade Carpenter
feb0d34213 pre-push: fix stdin line splitting when <local ref> has whitespace
From the `pre-push.sample` file:

> Information about the commits which are being pushed is supplied as
> lines to the standard input in the form:
>
>   <local ref> <local sha1> <remote ref> <remote sha1>

When `<local ref>` is not simply a branch name, but a more general
ref (see git-rev-parse(1)), it could contain whitespace, and that
breaks the split() call that expected only 3 spaces in the line.

Changed to use `rsplit(maxsplit=3)` since only the <local ref> is
likely to have embedded whitespace.

Added a new test case for the same.
2022-04-14 14:27:46 -07:00
Anthony Sottile
04de6a2e57 drop python 3.6 support
python 3.6 reached end of life on 2021-12-23
2022-01-18 18:44:20 -05:00
Jordan Speicher
4cd8b364dd Add: post-rewrite hook support 2021-09-01 14:50:59 -05:00
Florent Clarret
584fd585ec Expose local branch ref as an environment variable 2021-06-19 18:18:14 +02:00
Paweł Sacawa
6b73138c73 Add: post-merge hook support 2021-02-23 19:00:02 -08:00
surafelabebe
cb5ed6276d Expose remote branch ref as an environment variable 2021-01-22 13:18:25 -08:00
ModischFabrications
26adf1d560 add support for post-commit 2020-04-27 10:55:22 -07:00
Anthony Sottile
80a59db094 validate argument length as part of hook-impl 2020-04-15 12:30:44 -07:00
Anthony Sottile
d35b00352f Make more readable --from-ref / --to-ref aliases for --source / --origin 2020-02-23 11:07:57 -08:00
Andrew Hare
18fa004254 Add post-checkout 2020-02-23 10:22:18 -08:00
Anthony Sottile
95b8d71bd9 Move most of the actual hook script into pre-commit hook-impl 2020-01-21 16:41:22 -08:00