RFR: 1431: The method TestPullRequest#diff sometimes returns wrong information [v2]

Guoxiong Li gli at openjdk.org
Mon Aug 22 13:32:42 UTC 2022


On Mon, 22 Aug 2022 12:57:17 GMT, Magnus Ihse Bursie <ihse at openjdk.org> wrote:

>> I think you are misunderstanding the code. `"0".repeat(40)` just generates a string with 40 zeros, basically a null hash.
>> 
>> Looping to find the common ancestor is one way of doing it, but I would recommend checking out `git merge-base`. There is a method for it already on `GitRepository`.
>
> I see. Yes, I misunderstood the code as looping backwards for a maximum of 40. Don't know how I got to that conclusion. My brain is apparently still partially stuck in vacation mode. I don't think I'm used to methods being called on a string literal.

> Looping to find the common ancestor is one way of doing it, but I would recommend checking out `git merge-base`. There is a method for it already on `GitRepository`.

Thanks for reminding me. I change the code to use the method `mergeBase` just now.

-------------

PR: https://git.openjdk.org/skara/pull/1360


More information about the skara-dev mailing list