Open gerarts opened 7 years ago
We either change master
to refs/heads/master
in ProjectResource.java#L92 so that its not incorrectly matched to any other branch matching **master
in JGitRepositoryFacade.java#L157, or we should replace the endsWith(String)
with an equals(String)
comparison. The cleanest solution seems to be to prepend refs/heads/
if its not given, and then use an equals comparison instead. I think that's what Git is supposed to do under the hood too. But I am not certain what the side effects would be, as I remember that the branch prefix differs for bare and non-bare repositories. The git-server mostly uses bare-repositories, but not always. @LiamClark What do you think?
See also the commit https://github.com/devhub-tud/git-server/commit/ac0853872ce3d0f57bfbfa3b8429214665c3322d which kind of proves the point we have been struggling with a related issue before (as it was included in a hotfix release).
Visiting the repository shows the branch that was last pushed to in the menu on the right, but the contents of the
master
branch. Since these don't match up it makes for some confusion when checking if a push was successful.Edit: This happens when going to the repository root (for example by clicking on Commits in the menu on the left)