Fix: branch list empty#90
Conversation
Greptile SummaryThis PR fixes an edge case where Gitea returns an empty body (instead of an empty JSON array) for the
Confidence Score: 4/5The source-level fixes are correct and safe to merge; one test assertion in GitHubTest uses an undefined variable and will fail as written. The testGetRepository method in GitHubTest.php references $repo instead of $result on the two new pushed_at assertions. $repo is undefined in that scope, so the assertions will error at runtime and the new GitHub pushed_at coverage is effectively dead until corrected. tests/VCS/Adapter/GitHubTest.php — the two new assertions in testGetRepository reference $repo (undefined) instead of $result. Important Files Changed
Reviews (4): Last reviewed commit: "Merge branch 'main' into fix-gitea-branc..." | Re-trigger Greptile |
| $this->assertArrayHasKey('pushed_at', $repo); | ||
| $this->assertNotFalse(\strtotime($repo['pushed_at'])); |
There was a problem hiding this comment.
Wrong variable used inside
testGetRepository. The result of getRepository() is stored in $result, but the two new assertions reference $repo, which is undefined in this scope. PHP will issue an undefined-variable notice and both assertions will always evaluate against null, causing them to fail.
| $this->assertArrayHasKey('pushed_at', $repo); | |
| $this->assertNotFalse(\strtotime($repo['pushed_at'])); | |
| $this->assertArrayHasKey('pushed_at', $result); | |
| $this->assertNotFalse(\strtotime($result['pushed_at'])); |
|
Closed in favour of #105 |
No description provided.