1 | <?php |
||
20 | class Repository |
||
21 | { |
||
22 | /** |
||
23 | * Path to git repository root |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | private $root; |
||
28 | |||
29 | /** |
||
30 | * Path to .git directory |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | private $dotGitDir; |
||
35 | |||
36 | /** |
||
37 | * Commit message data |
||
38 | * |
||
39 | * @var \CaptainHook\Git\CommitMessage |
||
40 | */ |
||
41 | private $commitMsg; |
||
42 | |||
43 | /** |
||
44 | * Repository constructor. |
||
45 | * |
||
46 | * @param string $root |
||
47 | */ |
||
48 | 19 | public function __construct($root = null) |
|
57 | |||
58 | /** |
||
59 | * Returns the path to the hooks directory. |
||
60 | * |
||
61 | * @return string |
||
62 | */ |
||
63 | 3 | public function getHooksDir() |
|
67 | |||
68 | /** |
||
69 | * Check for a hook file. |
||
70 | * |
||
71 | * @param string $hook |
||
72 | * @return bool |
||
73 | */ |
||
74 | 2 | public function hookExists($hook) |
|
78 | |||
79 | /** |
||
80 | * CommitMessage setter. |
||
81 | * |
||
82 | * @param \CaptainHook\Git\CommitMessage $commitMsg |
||
83 | */ |
||
84 | 6 | public function setCommitMsg(CommitMessage $commitMsg) |
|
88 | |||
89 | /** |
||
90 | * CommitMessage getter. |
||
91 | * |
||
92 | * @return \CaptainHook\Git\CommitMessage |
||
93 | */ |
||
94 | 5 | public function getCommitMsg() |
|
101 | |||
102 | /** |
||
103 | * Is there a merge in progress. |
||
104 | * |
||
105 | * @return bool |
||
106 | */ |
||
107 | 4 | public function isMerging() |
|
116 | } |
||
117 |