devhub icon indicating copy to clipboard operation
devhub copied to clipboard

Going to the repository root shows wrong branch name in selection menu

Open gerarts opened this issue 8 years ago • 2 comments

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.

pasted_image_at_2017_04_28_01_35_pm

Edit: This happens when going to the repository root (for example by clicking on Commits in the menu on the left)

gerarts avatar Apr 28 '17 12:04 gerarts

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?

jwgmeligmeyling avatar May 01 '17 01:05 jwgmeligmeyling

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).

jwgmeligmeyling avatar May 01 '17 01:05 jwgmeligmeyling