1 | <?php |
||
25 | class PrepareCommitMsg extends Hook |
||
26 | { |
||
27 | /** |
||
28 | * Hook to execute |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | protected $hookName = Hooks::PREPARE_COMMIT_MSG; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | private $commentChar; |
||
38 | |||
39 | /** |
||
40 | * Path to commit message file |
||
41 | * |
||
42 | * @var string |
||
43 | */ |
||
44 | private $file; |
||
45 | |||
46 | /** |
||
47 | * Commit mode, empty or [message|template|merge|squash|commit] |
||
48 | * |
||
49 | * @var string |
||
50 | */ |
||
51 | private $mode; |
||
52 | |||
53 | /** |
||
54 | * Commit hash if mode is commit during -c or --amend |
||
55 | * |
||
56 | * @var string |
||
57 | */ |
||
58 | private $hash; |
||
59 | |||
60 | /** |
||
61 | * Fetch the original hook arguments and message related config settings |
||
62 | * |
||
63 | * @return void |
||
64 | */ |
||
65 | public function beforeHook() |
||
78 | |||
79 | /** |
||
80 | * Read the commit message from file |
||
81 | * |
||
82 | * @return void |
||
83 | */ |
||
84 | public function beforeAction() |
||
89 | |||
90 | /** |
||
91 | * Write the commit message to disk so git or the next action can proceed further |
||
92 | * |
||
93 | * @return void |
||
94 | */ |
||
95 | public function afterAction() |
||
100 | } |
||
101 |