Skip to content

Commit dc6573e

Browse files
Merge branch 'gitonomy:main' into main
2 parents 4937935 + de32cc0 commit dc6573e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/Gitonomy/Git/Parser/DiffParser.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ protected function doParse()
102102
while ($this->expects('@@ ')) {
103103
$vars = $this->consumeRegexp('/-(\d+)(?:,(\d+))? \+(\d+)(?:,(\d+))?/');
104104
$rangeOldStart = (int) $vars[1];
105-
$rangeOldCount = (int) $vars[2];
105+
$rangeOldCount = (int) ($vars[2] ?? 1);
106106
$rangeNewStart = (int) $vars[3];
107-
$rangeNewCount = isset($vars[4]) ? (int) $vars[4] : (int) $vars[2]; // @todo Ici, t'as pris un gros raccourci mon loulou
107+
$rangeNewCount = (int) ($vars[4] ?? 1);
108108
$this->consume(' @@');
109109
$this->consumeTo("\n");
110110
$this->consumeNewLine();

tests/Gitonomy/Git/Tests/RepositoryTest.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ public function testGetBlobWithExistingWorks($repository)
4343
public function testGetSize($repository)
4444
{
4545
$size = $repository->getSize();
46-
$this->assertGreaterThanOrEqual(53, $size, 'Repository is at least 53KB');
47-
$this->assertLessThan(80, $size, 'Repository is less than 80KB');
46+
$this->assertGreaterThanOrEqual(57, $size, 'Repository is at least 57KB');
47+
$this->assertLessThan(84, $size, 'Repository is less than 84KB');
4848
}
4949

5050
public function testIsBare()

0 commit comments

Comments
 (0)