| Conditions | 3 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 4 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 35 | public function newCurrentHistoryMarker(ProjectRoot $projectRoot, bool $forceBaselineCreation): HistoryMarker |
||
| 36 | { |
||
| 37 | // Create gitHistoryMarker first. |
||
| 38 | // This will correctly deal with issues when $projectRoot is not pointing to a valid git repo. |
||
| 39 | $gitHistoryMarker = $this->gitCliWrapper->getCurrentSha($projectRoot); |
||
| 40 | |||
| 41 | // Return it if we are forcing baseline creation or the git repo is clean (i.e. no unchanged/new files) |
||
| 42 | if ($forceBaselineCreation || $this->gitCliWrapper->isClean($projectRoot)) { |
||
| 43 | return $gitHistoryMarker; |
||
| 44 | } |
||
| 45 | |||
| 46 | throw new GitNotCleanException(); |
||
| 47 | } |
||
| 49 |