Skip to content

Commit

Permalink
Set default range counts (#211)
Browse files Browse the repository at this point in the history
* Set default range counts

* Force ints
  • Loading branch information
simonhamp authored May 3, 2024
1 parent a8bfcd1 commit de32cc0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Gitonomy/Git/Parser/DiffParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,9 +102,9 @@ protected function doParse()
while ($this->expects('@@ ')) {
$vars = $this->consumeRegexp('/-(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))?/');
$rangeOldStart = (int) $vars[1];
$rangeOldCount = (int) $vars[2];
$rangeOldCount = (int) ($vars[2] ?? 1);
$rangeNewStart = (int) $vars[3];
$rangeNewCount = isset($vars[4]) ? (int) $vars[4] : (int) $vars[2]; // @todo Ici, t'as pris un gros raccourci mon loulou
$rangeNewCount = (int) ($vars[4] ?? 1);
$this->consume(' @@');
$this->consumeTo("\n");
$this->consumeNewLine();
Expand Down

0 comments on commit de32cc0

Please sign in to comment.