You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using the library from Rust using git2-rs, apologies if this isn't the exact C code to do it!
It is a relatively simple thing to do though, so I should've got it right I think.
Expected behavior
git_reference_cmp returns a non-zero value (it doesn't matter what, but could be the same as strcmp("refs/foo", "refs/bar")).
Actual behavior
git_reference_cmp returns zero, suggesting that the two references are actually the same.
Version of libgit2 (release number or SHA1)
libgit2 1.4
Operating system(s) tested
Windows 10
The text was updated successfully, but these errors were encountered:
Right. Well, I'm surprised by this, but apparently git_reference_cmp ignores the reference name and only compares the type and the target. This isn't the behavior that I would have expected.
I think that this is one of those things that was implemented incorrectly, but done so a decade ago and would be a breaking change. I think that we should fix this, but when we do breaking changes ahead of our 2.0.
I don't know if this is the intended behaviour, but...
Reproduction steps
Setup the repo with normal
git
:Compare the references with
libgit2
:Expected behavior
git_reference_cmp
returns a non-zero value (it doesn't matter what, but could be the same asstrcmp("refs/foo", "refs/bar")
).Actual behavior
git_reference_cmp
returns zero, suggesting that the two references are actually the same.Version of libgit2 (release number or SHA1)
libgit2 1.4
Operating system(s) tested
Windows 10
The text was updated successfully, but these errors were encountered: