@@ -79,7 +79,7 @@ def _add_hook_type_option(parser: argparse.ArgumentParser) -> None:
7979 parser .add_argument (
8080 '-t' , '--hook-type' , choices = (
8181 'pre-commit' , 'pre-merge-commit' , 'pre-push' ,
82- 'prepare-commit-msg' , 'commit-msg' ,
82+ 'prepare-commit-msg' , 'commit-msg' , 'post-checkout' ,
8383 ),
8484 action = AppendReplaceDefault ,
8585 default = ['pre-commit' ],
@@ -92,11 +92,17 @@ def _add_run_options(parser: argparse.ArgumentParser) -> None:
9292 parser .add_argument ('--verbose' , '-v' , action = 'store_true' , default = False )
9393 parser .add_argument (
9494 '--origin' , '-o' ,
95- help = "The origin branch's commit_id when using `git push`." ,
95+ help = (
96+ "The origin branch's commit_id when using `git push`. "
97+ 'The ref of the previous HEAD when using `git checkout`.'
98+ ),
9699 )
97100 parser .add_argument (
98101 '--source' , '-s' ,
99- help = "The remote branch's commit_id when using `git push`." ,
102+ help = (
103+ "The remote branch's commit_id when using `git push`. "
104+ 'The ref of the new HEAD when using `git checkout`.'
105+ ),
100106 )
101107 parser .add_argument (
102108 '--commit-msg-filename' ,
@@ -123,6 +129,14 @@ def _add_run_options(parser: argparse.ArgumentParser) -> None:
123129 '--files' , nargs = '*' , default = [],
124130 help = 'Specific filenames to run hooks on.' ,
125131 )
132+ parser .add_argument (
133+ '--checkout-type' ,
134+ help = (
135+ 'Indicates whether the checkout was a branch checkout '
136+ '(changing branches, flag=1) or a file checkout (retrieving a '
137+ 'file from the index, flag=0).'
138+ ),
139+ )
126140
127141
128142def _adjust_args_and_chdir (args : argparse .Namespace ) -> None :
0 commit comments