When configuring jenkins, I want to detect feature branches whether they have merging conflicts, so I use github api v3 to test on 2 intentional conflicted branches.
After merge branch1 to master, I compared branch2(b2) like this:
curl -i https://api.github.com/repos/hao1987/myself/compare/hao1987:master...hao1987:b2
and it returns a long json which has an attribute:
"status": "diverged"
I wonder if that means conflict, and where I can try types of "status"
This isn't documented (sorry!), but status can be one of four things:
"diverged" = commits were introduced on both the head and base branch since the common ancestor"ahead" = commits were introduced on head after the common ancestor with base"behind" = commits were introduced on base after the common ancestor with head"identical" = branches point to same commitSo, "diverged" doesn't tell you whether a merge between the branches would result in merge conflicts.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With