|
86 | 86 | @test hasghobj("master", first(branches(ghjl; auth = auth)))
|
87 | 87 |
|
88 | 88 | # test GitHub.compare
|
89 |
| - @test compare(ghjl, "master", "master~"; auth = auth).behind_by == 1 |
90 |
| - let comparison = compare(ghjl, "master~", "master"; auth = auth) |
91 |
| - @test comparison.ahead_by == 1 |
92 |
| - @test length(comparison.commits) == 1 |
| 89 | + # check if the latest commit is a merge commit |
| 90 | + latest_commit = GitHub.branch(ghjl, "master"; auth=auth).commit |
| 91 | + is_latest_commit_merge = length(latest_commit.parents) > 1 |
| 92 | + if is_latest_commit_merge |
| 93 | + @test compare(ghjl, "master", "master~"; auth = auth).behind_by >= 1 |
| 94 | + let comparison = compare(ghjl, "master~", "master"; auth = auth) |
| 95 | + @test comparison.ahead_by >= 1 |
| 96 | + @test length(comparison.commits) >= 1 |
| 97 | + end |
| 98 | + else |
| 99 | + @test compare(ghjl, "master", "master~"; auth = auth).behind_by == 1 |
| 100 | + let comparison = compare(ghjl, "master~", "master"; auth = auth) |
| 101 | + @test comparison.ahead_by == 1 |
| 102 | + @test length(comparison.commits) == 1 |
| 103 | + end |
93 | 104 | end
|
94 | 105 |
|
95 | 106 | # test GitHub.file, GitHub.directory, GitHub.readme, GitHub.permalink
|
|
0 commit comments